[wp-trac] [WordPress Trac] #20973: date_i18n() produces invalid output for shorthand formats

WordPress Trac noreply at wordpress.org
Sat Oct 12 05:17:27 UTC 2013


#20973: date_i18n() produces invalid output for shorthand formats
--------------------------+------------------------------
 Reporter:  Rarst         |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Date/Time     |     Version:  3.4
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------

Comment (by Rarst):

 Replying to [comment:20 raubvogel]:
 > Tested
 > {{{
 > var_dump( date_i18n( DATE_RFC2822 ) ); // string 'Sa, 12 Okt 2013
 00:43:18 +0200' (length=30)
 > var_dump( date_i18n( 'r' ) ); // 'Sat, 12 Oct 2013 00:43:18 +0200'
 (length=31)
 > }}}
 > Worked with my patch. Cannot find an issue :-( Used
 functions.php.2.patch

 Yes, the ''timezone'' works with your patch. See how day and month are
 different? This is because of same issue with parsing formats, which your
 patch doesn't address because it ''only'' tries to fix timezone.

 > Your patch is elegant, but covers only 'c', 'r'. There are many more
 cases [http://www.php.net/manual/de/function.date.php], right?

 Yes, however ''it seems'' other (not compound) formats are all (?) already
 supported by `date_i18n()`. As above I have two issues left here - is
 "unpacking" them good enough of a solution and doing bit of a testing to
 be sure which other formats might need to be handled.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/20973#comment:21>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list