[wp-trac] [WordPress Trac] #48384: get_post_time returns wrong value after timezone switch
WordPress Trac
noreply at wordpress.org
Wed Oct 23 03:44:00 UTC 2019
#48384: get_post_time returns wrong value after timezone switch
-------------------------------------------------+-------------------------
Reporter: david.binda | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.3
Component: Date/Time | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests commit | Focuses:
dev-feedback |
-------------------------------------------------+-------------------------
Comment (by SergeyBiryukov):
Replying to [comment:13 SergeyBiryukov]:
> I've noticed that [source:tags/5.2.4/src/wp-admin/includes/class-wp-
posts-list-table.php?marks=1062#L1053 get_post_time()] returns false
there, and the output defaults to `mysql2date( __( 'Y/m/d' ), $m_time )`,
instead of `human_time_diff( $time )`, but haven't yet tracked it down
further.
Ah, it's because for drafts `post_date` is the creation date, but with the
patch we're now looking at `post_date_gmt`, which is `0000-00-00
00:00:00`, which in turn causes `get_post_datetime()` to return false.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48384#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list