[buddypress-trac] [BuddyPress] #3522: Fix timezone != GMT creates wrong "posted xyz ago" dates
buddypress-trac at lists.automattic.com
buddypress-trac at lists.automattic.com
Fri Sep 2 04:30:48 UTC 2011
#3522: Fix timezone != GMT creates wrong "posted xyz ago" dates
-------------------------------------------------------+------------------
Reporter: sboisvert | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 1.6
Component: Core | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing reporter-feedback |
-------------------------------------------------------+------------------
Comment (by cnorris23):
I'm with DJPaul on this. I've tried multiple combinations of timezone
settings. The most convoluted was where PHP was set to one TZ, the server
to another, and WP to another. I couldn't break anything. I then read the
PHP documentation on the issue. As far as PHP is concerned, this is how
the tz is determined (http://www.php.net/manual/en/function.date-default-
timezone-get.php):
1. The date_default_timezone_set() setting
2. the TZ environment variable (PHP prior to 5.3.0)
3. the date.timezone ini option
4. the host OS
5. if all the above fail, default to UTC
WP uses date_default_timezone_set( 'UTC' ) very early on (in wp-
settings.php) which means that to PHP, we're always on UTC. No matter your
WP or server setup, all time is UTC, get_gmt_from_date() being the only
exception. I think it's safe to mark this as invalid, but just in case:
@sboisvert, can you provide some more details? Are you having this issue
on all new posts, or is the time only off on old posts? With what specific
components are you having this issue? What's your PHP version, and are you
on a Windows or Linux server?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/3522#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list