[wp-trac] [WordPress Trac] #24730: Introduce a timezone-retrieval method
WordPress Trac
noreply at wordpress.org
Fri Jul 12 03:37:22 UTC 2013
#24730: Introduce a timezone-retrieval method
-------------------------+-----------------------------
Reporter: rmccue | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Date/Time | Version:
Severity: normal | Keywords: has-patch
-------------------------+-----------------------------
When working with times and dates, it's useful to have the timezone used
in WordPress, however there's no unified way to get it.
`get_option('gmt_offset')` is filtered and the '''current''' offset is
translated from the timezone string, but there's no reverse which is
needed when working with relative times and dates.
There are two ways we could handle this:
1. Filter `timezone_string` and work out the correct string - This will
likely break the admin interface for it.
2. Introduce a new function to get the timezone from `timezone_string`,
and fall back to `gmt_offset` if needed.
Patch has implementation of the second option (also using DateTimeZone),
can be adapted as necessary for the first.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24730>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list