[wp-trac] [WordPress Trac] #63834: Block post-date doesn't show date for postings modified on same day am/pm (Fix included)

WordPress Trac noreply at wordpress.org
Sat Aug 16 21:01:54 UTC 2025


#63834: Block post-date doesn't show date for postings modified on same day am/pm
(Fix included)
--------------------------+---------------------------------
 Reporter:  gchriz        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  6.8.2
 Severity:  normal        |   Keywords:  block time modified
  Focuses:                |
--------------------------+---------------------------------
 The block "post-date" used with displayType "modified" doesn't show
 anything if the creation of the post/page is before 01:00 pm and the last
 modification is on the same day.

 That is due to a bug in the code.

 In line 52 of file `wp-includes/blocks/post-date.php` the queried date
 format uses "h" for a 12-hour clock and therefore the comparison fails
 like described above.

 `if ( get_the_modified_date( 'Ymdhi', $post_ID ) > get_the_date( 'Ymdhi',
 $post_ID ) ) {`

 It needs to be "H" for 24-hour clock:

 `if ( get_the_modified_date( 'YmdHi', $post_ID ) > get_the_date( 'YmdHi',
 $post_ID ) ) {`

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63834>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list