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.
Built from https://develop.svn.wordpress.org/trunk@45853


git-svn-id: http://core.svn.wordpress.org/trunk@45664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2019-08-19 19:08:59 +00:00
parent 82af4ad1c0
commit 4896dc64ee
2 changed files with 44 additions and 2 deletions

View File

@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-45852';
$wp_version = '5.3-alpha-45853';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.