Closed (outdated)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Jun 2009 at 17:58 UTC
Updated:
2 Mar 2016 at 22:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damien tournoud commentedGood catch, but bugs get fixed in the current development version first (D7) before being backported.
Comment #2
mfbThis is already fixed in Drupal 7. However, in Drupal 6, the "e" format specifier (time zone identifier, examples: UTC, Atlantic/Azores) cannot be properly supported because Drupal 6 has no idea what named time zone you are formatting the date for. It only has a (faulty) concept of time zone offsets from GMT. So it seems best to not add "e".
Comment #3
adamdicarlo commentedWould it be acceptable to at least add support for c and P, and document the lack of 'e' support in the function's doxygen comment? If so I'd be happy to roll the patch.
Comment #4
damien tournoud commented@adamdicarlo: sounds good.
Comment #5
aaron.r.carlton commentedsubscribing - hope this makes it in soon.
Comment #6
adamdicarlo commentedHere's a new patch -- hopefully my addition to the function header comment is clear enough.
Comment #7
dstolSimilar, #646932: format_date incorrectly formats all timezone identifiers as 'GMT', but fixes issue described here.
Comment #8
dstolI'm sure I am mistaken here, BUT, my brief amount of testing has shown that if I correctly set the site's timezone the value for e is correct when I've patched with #646932: format_date incorrectly formats all timezone identifiers as 'GMT'. I THINK mfb in #2 is only for gmdate() since it will only ever return GMT.
Comment #9
mfbThe time zone value for
date('e')would depend on the server environment's time zone setting. It's certainly possible to get a correct value, but could also be incorrect depending on the server environment.The patch at #6 definitely doesn't work because it will always output a GMT time zone while the date/time will have an offset applied, which results in incorrect output for e.g.
format_date(time(), 'custom', 'c')Comment #10
dstolThe more I get into this issue I realize D6 wasn't designed to support these specifiers. These guys come from the server environment, as per #9. Check out the screen shots. The only thing I'm doing is changing the timezone on my computer. Notice that the actual time DOESN'T change.
Now that doesn't mean you can't use c,e,P,T.
What I've found best is
I've also included a documentation fix as per adamdicarlo in #6. 494434-11-fix.patch, in #11 below, needs to be reviewed.
Don't use the two patches included here use the ones in #11.
Comment #11
dstolIgnore the two patches in #10, I wasn't in the root directory when I made them. These are what you want.
Comment #12
dstolComment #14
AlexisWilke commentedNote that the year, month, day, hour, and minutes are also affected by the timezone. So Y, m, d, H, i and some others too are all wrong too. It seems to me that gmdate() should never be used in a function that is expected to be used with a local date.
Thank you.
Alexis Wilke