Hello,
I'm using the Submitted By module in conjunction with Token, and trying to make the date tokens ([day], [d] [mon] [yyyy]) display the date in the logged in user's time zone which they have chosen on their profile page. Currently the pattern above displays the node's creation date in the site's default time zone, and try as I might, I can't find any way to get it to display the date/time in the user's selected time zone.
My site's default time zone is EST (New York). So if a logged-in user in Hong Kong creates a node on Monday morning (their time) and publishes it, the creation date is displayed as Sunday evening (site's default timezone), which is confusing to the user.
Apologies if this is answered somewhere else, but honestly I searched and searched for well over an hour, and could not find an explanation or solution. If anyone has any ideas, it would be greatly appreciated.
Comment | File | Size | Author |
---|---|---|---|
#9 | 991500-token-format-date-speedup.patch | 2.79 KB | Dave Reid |
#8 | 991500-token-format-date-speedup.patch | 2.99 KB | Dave Reid |
#7 | 991500-token-format-date-speedup.patch | 5.51 KB | Dave Reid |
#5 | 991500-token-date-timestamp.patch | 4.45 KB | Dave Reid |
#4 | 991500-token-date-timestamp.patch | 3.99 KB | Dave Reid |
Comments
Comment #1
Dave ReidAh, that's a good point. The D6 date tokens hard-code the timezone of the default site timezone, whereas the D7 core date tokens use the user's timezone, which seems like the proper behavior.
Comment #2
Dave ReidGrr, wrong set of files to patch.
Comment #3
Dave ReidComment #4
Dave ReidGrr, we have to end of duplicating format_date() completely to support the 'N' character.
Comment #5
Dave ReidComment #6
Dave ReidCommitted #5 to CVS.
Comment #7
Dave ReidWanted to speed this up a little bit.
Comment #8
Dave ReidWithout the extra hunk this time...
Comment #9
Dave ReidWow, super glad we have good tests for these.
Comment #10
Dave ReidCommitted #9 to CVS.
http://drupal.org/cvs?commit=463902
Comment #12
WildBill CreditAttribution: WildBill commentedApologies for my late reply - was sick and Internet has been wonky.
I've installed the dev version of Token and it definitely fixes this issue.
Many thanks Dave, you rock!