[drupal-devel] [bug] function format_date uses gmdate() incorrectly

clydefrog drupal-devel at drupal.org
Sat Sep 3 23:05:42 UTC 2005


Issue status update for 
http://drupal.org/node/29681
Post a follow up: 
http://drupal.org/project/comments/add/29681

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     bug reports
 Priority:     normal
 Assigned to:  thehunmonkgroup
 Reported by:  thehunmonkgroup
 Updated by:   clydefrog
 Status:       patch (code needs review)

Are you sure about the logic here? I've tried to fix timezone issues
before, and I always get confused. My reading of the documentation
makes me think your patch is wrong:


If the timestamp has already been converted to a localized time, then
gmdate() should be used because gmdate() does no timezone adjustments
(it does not care what PHP's timezone settings are). Using date() is
incorrect because it does care what PHP's timezone settings are.




clydefrog



Previous comments:
------------------------------------------------------------------------

Thu, 25 Aug 2005 22:04:51 +0000 : thehunmonkgroup

Attachment: http://drupal.org/files/issues/format_date.patch (817 bytes)

function format_date in common.inc is using gmdate() incorrectly.  the
function is trying to format a local timestamp, and GMT conversion is
incorrect in this case.  date() should be used instead.  bug also
exists in 4.6, and this patch should apply there, too.  haven't checked
the earlier versions of drupal...




------------------------------------------------------------------------

Sat, 27 Aug 2005 04:47:39 +0000 : thehunmonkgroup

switching to patch status







More information about the drupal-devel mailing list