Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#43480 closed enhancement (worksforme)

Add $gmt parameter to the_time() function

Reported by: paulschreiber's profile 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 7 years ago.

Download all attachments as: .zip

Change History (5)

@paulschreiber
7 years ago

#1 @paulschreiber
7 years ago

  • Keywords has-patch added

#3 @Rarst
7 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
7 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.