#20501: Timezone bug in wp-settings.php
--------------------------+------------------------------
Reporter: j-idris | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version: 3.3.1
Severity: normal | Resolution:
Keywords: close |
--------------------------+------------------------------
Comment (by j-idris):
Thanks for the clarification. I understand now why UTC is used. That being
the case, why bother having the if statement at all. Why not just set UTC
without checking for existence of the set function? It's irrelevant
anyway.
This article clearly explains the reason behind this issue and how to get
the correct timestamp based on the timezone string setting in the admin.
http://codex.wordpress.org/Function_Reference/current_time
Replying to [comment:1 dd32]:
> !WordPress sets the defaulte timezone to UTC as it doesn't use the
systems timezone, the majority of users are not located in the same
timezone as their servers afterall, and relying on UTC as the core
underlying timezone is the simplest option.
>
> Instead, !WordPress has a Timezone setting in the Options, which allows
the time functions within !WordPress to return a timezone which the user
expects. As a result, all dates produced by !WordPress will be in the
timezone the user has specified, and not what their sysadmin set the
servers timezone to. There will be cases where the PHP timezone will be
set correctly, and the user hasn't set a proper timezone in WordPress, but
this case is much more uncommon than the before mentioned.
>
> (Also note, That code alteration is just asking for trouble, If not a
function exists, call that function.. - A word to anyone who has this
"problem" and tries to use that code to solve it, don't)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20501#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software