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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Version: 6.x-1.15 » 6.x-1.x-dev
Assigned: Unassigned » Dave Reid
Category: support » bug
Status: Active » Needs review
FileSize
7.63 KB

Ah, 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.

Dave Reid’s picture

Grr, wrong set of files to patch.

Dave Reid’s picture

Dave Reid’s picture

Grr, we have to end of duplicating format_date() completely to support the 'N' character.

Dave Reid’s picture

Dave Reid’s picture

Status: Needs review » Fixed

Committed #5 to CVS.

Dave Reid’s picture

Status: Fixed » Needs review
FileSize
5.51 KB

Wanted to speed this up a little bit.

Dave Reid’s picture

Without the extra hunk this time...

Dave Reid’s picture

Wow, super glad we have good tests for these.

Dave Reid’s picture

Status: Needs review » Fixed
WildBill’s picture

Apologies 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!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.