I am trying to get correctly the difference of the current time and a blog’s post. When I echo the post’s time I get this Sun, 05 Jun 2011 07:24:00 +0000 while the correct time should be Sun, 05 Jun 2011 10:24:00 +0000 it’s also shown on the XML feed.
With time(); I get the current time. My current time is 19:44. and this is the output of the function below 'day': 5,'month': 0,'year': 0,'hour': 2,'min': 14,'sec': 37 5 days, 2 hours, 20 mins and 37 sec.
How can I correctly show the passed time, by adding 9 hours to the output result ? ( It should be 12 hours but the 3 are “lost” as I said above).
have you tried
$my_time = strtotime("+9 hours")? it’ll return your current time +9 hours in unix format, you can get format it as you like