[wp-trac] [WordPress Trac] #24730: Introduce a timezone-retrieval method
WordPress Trac
noreply at wordpress.org
Mon Aug 19 19:07:14 UTC 2019
#24730: Introduce a timezone-retrieval method
--------------------------------------+-----------------------------
Reporter: rmccue | Owner: SergeyBiryukov
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.3
Component: Date/Time | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Changes (by SergeyBiryukov):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"45853" 45853]:
{{{
#!CommitTicketReference repository="" revision="45853"
Date/Time: Introduce `wp_timezone_string()` and `wp_timezone()` for
unified timezone retrieval.
* `wp_timezone_string()` retrieves the timezone from current settings as a
string. Uses the `timezone_string` option to get a proper timezone if
available, otherwise falls back to an offset.
* `wp_timezone()` retrieves the timezone from current settings as a
`DateTimeZone` object. Timezone can be based on a PHP timezone string or a
`±HH:MM` offset.
Props Rarst, remcotolsma, johnjamesjacoby, rmccue.
Fixes #24730.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/24730#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list