From: "Kiffin Gish" <kiffin.g...@planet.nl>
Well actually I want to relate it to the timezone of the current user or
if that is not set in the user preferences, the browser time.

After you get the user time zone from users preferences, you can send it as a parameter to set_time_zone() method of DateTime.

You can do it in the templates:

[% row.last_modified.set_time_zone(c.user.get('time_zone')).strftime('%F %T') %]

(not tested, but it should work)

Don't know how to get the time zone of the user from browser, but I think it is not possible. You might need to get the visitor's IP and use a service that can tell you his/her country or even city, and maybe there is a module that can translate that into DateTime time_zone rformat...

Octavian


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to