[wp-trac] [WordPress Trac] #25555: get_comment_time('c') and date_i18n('c') uses UTC timezone only

WordPress Trac noreply at wordpress.org
Thu Oct 10 14:52:53 UTC 2013


#25555: get_comment_time('c') and date_i18n('c') uses UTC timezone only
--------------------------+------------------------
 Reporter:  raubvogel     |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Date/Time     |     Version:  3.6.1
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |
--------------------------+------------------------

Comment (by raubvogel):

 Replying to [comment:1 johnbillion]:
 > `date_i18n()` doesn't take into account the site's timezone because it's
 a localisation function. The function is intended to format the date
 string according to the site's locale.
 >
 > To get the date in the site's specified timezone you should use
 `get_date_from_gmt()`. See the example given in the comments on #25331.

 I do not know if {{{date_i18n()}}} is implemented correctly. Anyway, look
 at {{{get_comment_time('c')}}} please. The result is deftly not correct.
 You can see this if you just take the default Twentythirteen theme.
 {{{get_comment_time('c')}}} is used in comments and outputs a wrong
 {{{<time datetime="2013-10-10T12:22:56+00:00">}}} tag. Please look at
 wordpress\wp-includes\comment-template.php:1684 – it’s used in the core.
 Finally something is wrong. Can You please reopen the ticket?

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


More information about the wp-trac mailing list