Ticket #314 (assigned defect)

Opened 6 weeks ago

Last modified 6 weeks ago

query.cc: $date returns time in GMT only

Reported by: sage Owned by: olly
Priority: normal Milestone: 1.1.0
Component: Omega Version: 1.0.9
Severity: normal Keywords:
Cc: Blocked By:
Operating System: All Blocking:

Description

The $date function uses gmtime() instead localtime() for converting time into tm structure. It is not possible to get time according locale system settings.

Change History

Changed 6 weeks ago by olly

  • status changed from new to assigned
  • milestone set to 1.1.0

localtime() isn't really the correct answer either - the timezone the server is in is usually an "implementation detail". On an intranet it will probably work OK (unless your intranet spans multiple timezones), but not for a website on the internet.

But there certainly is an issue here - UTC is an arbitrary choice.

Ideally we'd determine the timezone of the end-user automatically and use that, but it's not trivial to find - it requires some javascript magic, and a mechanism to get the information back to the server.

Perhaps in the short term, localtime() is better than gmtime() since at least it works better for most intranet cases.

Note: See TracTickets for help on using tickets.