[wp-hackers] Possible bug in the function human_time_diff()
ckunte at gmail.com
Thu Mar 26 11:41:05 GMT 2009
To add to my previous observation, and going by the logic, I need to
set my location time to match my server time, or else
human_time_diff() shows time erroneously for the day it is published.
Currently I've set my time as GMT +1 under settings. But if I set it
as GMT-6 (same as my server time instead of my actual location time),
then there would be no more time zone crossing point, and so the time
would continuously increase (not descend until it reaches your actual
time zone before ascending like I mentioned earlier). But then it
defeats the purpose of having a time zone setting in WordPress---at
least in this case.
On Thu, Mar 26, 2009 at 12:26 PM, Chetan Kunte <ckunte at gmail.com> wrote:
>> The function "get_the_time" will get the time for the current post.
>> Are you putting this code in the correct place in the Loop?
> Yes, I am. It is a simple loop. It displays post date followed by post
> title. I have replaced the the_time() or the_date() call with echo
> human_time_diff() . With the exception of the day it is published on,
> it works fine for other days. On the day it is published, due to
> perhaps time zones, it gets 'mungled', I think.
> Here's what's happening:
> Host server is in GMT -6.
> I am publishing from GMT+1.
> 1 minute after publishing, it shows 5 hours ago, so appararently it is
> doing this: abs(-6+1)= 5hrs ago.
> 1 hour later, it becomes, I think abs(-6+1+1)= 4hrs ago.
> 5 hours, 1min later, abs(-6+1+5)= 1min ago.
> 6 hours later, abs(-6+1+6)= 1 hour ago.
> 12 hours later abs(-6+1+12) = 7hours ago.
> Does anyone else has seen this happening?
More information about the wp-hackers