Make WordPress Core

Timestamp:
08/19/2019 07:07:03 PM (7 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 added

Note: See TracChangeset for help on using the changeset viewer.