WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#43480 closed enhancement (worksforme)

Add $gmt parameter to the_time() function

Reported by: paulschreiber Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.9.4
Component: Date/Time Keywords: has-patch reporter-feedback
Focuses: Cc:

Description

It would be helpful to add a $gmt parameter to the_time().

calling:

the_time( 'c', true );

is cleaner/easier than:

echo esc_attr( get_post_time( 'c', true ) );

Use case:
This format of timestamp is required for microformats metadata.

Attachments (1)

43480.patch (1.3 KB) - added by paulschreiber 4 years ago.

Download all attachments as: .zip

Change History (5)

@paulschreiber
4 years ago

#1 @paulschreiber
4 years ago

  • Keywords has-patch added

#3 @Rarst
4 years ago

This will break backwards compatibility on the_time filter, since it doesn't have a concept of GMT time being requested. Even if the flag is added to it as parameter, any existing filter out there would not know to check for it.

#4 @Rarst
3 years ago

  • Keywords reporter-feedback added
  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.