[wp-trac] [WordPress Trac] #25002: get_post_time() doesn't return correct GMT time if date_default_timezone_set is changed from UTC.
WordPress Trac
noreply at wordpress.org
Tue Sep 17 11:13:36 UTC 2019
#25002: get_post_time() doesn't return correct GMT time if
date_default_timezone_set is changed from UTC.
--------------------------------------+-----------------------------
Reporter: johnregan3 | Owner: SergeyBiryukov
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.3
Component: Date/Time | Version: 1.2
Severity: normal | Resolution: fixed
Keywords: has-unit-tests has-patch | Focuses:
--------------------------------------+-----------------------------
Changes (by SergeyBiryukov):
* status: reviewing => closed
* resolution: => fixed
Comment:
In [changeset:"46154" 46154]:
{{{
#!CommitTicketReference repository="" revision="46154"
Date/Time: Introduce `get_post_datetime()` to retrieve post published or
modified time as a `DateTimeImmutable` object instance.
Introduce `get_post_timestamp()` to retrieve post published or modified
time as a Unix timestamp.
Use `get_post_datetime()` in `get_post_time()` and
`get_post_modified_time()` to return correct GMT time if default timezone
is changed from UTC.
Props Rarst, johnregan3.
Fixes #25002.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/25002#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list