Introduce a timezone-retrieval method
|Reported by:||rmccue||Owned by:|
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:
- Filter timezone_string and work out the correct string - This will likely break the admin interface for it.
- 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.