#256 closed defect (bug) (duplicate)
Calculate time differences in GMT
Reported by: | hudatoriq | Owned by: | hudatoriq |
---|---|---|---|
Milestone: | Priority: | major | |
Severity: | Version: | 1.0 | |
Component: | Keywords: | time since gmt | |
Cc: |
Description
The function bp_core_time_since() use the current time to compare older date to if parameter $newer_date is not specified. Currently it uses the time() function which returns the current time in server timezone. But the old date we want to calculate isn't always in the same timezone. It often create error results.
Solution:
Use the WP function current_time() instead to get the current time in GMT. All time that need to be calculated against current time using bp_core_time_since() will have to be in GMT as well.
Attachments (1)
Change History (7)
#3
@
16 years ago
@mgkimsal
I think I'm gonna close this ticket. I have posted a new one in #257
This ticket only solves part of the problem: the timezone that is considered as NOW when calculating time differences. The old time that is calculated should also be converted in GMT if you're using this patch.
It's also interfered with the WordPress bug. http://trac.wordpress.org/ticket/8662
Anyway, using the time server timezone is a bad idea. Most people don't care what timezone the server they're using is on.
I think we should push the patch http://trac.wordpress.org/ticket/8662 for immediate commit. I hope this will be merged in 2.7.1. For WPMU, I wish it could be committed before final 2.7 release. Is it possible to do that?
Andy, if you're seeing this, I hope you tell the other automattic guy that is responsible for WP core & WPMU.
I tried that change and it still didn't work for me. Changing the "0" in the 60*60*0 to my time zone (-5) worked.