Issue 1327: formatDate(Date, "u") gives incorrect time
Status:  Duplicate
Merged:  issue 783
Owner: ----
Closed:  Aug 2013
Reported by zippidy...@gmail.com, Mar 5, 2012
This is a bug report for the behavior as outlined in #783.

The calendar handles all dates in local time (user's system time), with the exception of fetching a date using the formatDate method and "u" as the format parameter. In this case the time is returned in fake zulu time. What I mean by that is, there is no offset calculation from the user's local time to zulu time, rather the date simply claims to be zulu time (which is a lie in every case except when the user's local time is UTC).

The solution in #783, I think, is reasonable, though I have not tested it. However, I will note that adding a "Z" is only acceptable when the time is in zulu time (UTC), where no timezone offset is specified. For example, these all represent the same point in time and are all valid ISO 8601:

2012-03-05T23:38:00Z
2012-03-05T15:38:00-08:00
2012-03-05T23:38:00+00:00

If you choose to keep "u" in zulu time (which is perfectly acceptable), you must convert the user's local time to UTC.

Cody

Aug 15, 2013
Project Member #1 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 783