| Issue 34: | W3CDateConverter not serializing/deserializing hourUTC properly |
1 of 3
Next ›
|
| Back to list |
What steps will reproduce the problem? 1. Serializing/Deserializing UTC Date 2. 3. What is the expected output? What do you see instead? After deserializing, in Flex, I expect to see the UTC Hour in the hourUTC field, but I see the local hour. (e.g. 2010-11-12T10:00:55.627-07:00 should put 10 in the hour property and 17 in the hourUTC property, but it's putting 3 in the hour property and 10 in the hourUTC property) Serializing has a similar effect. After converting to a string, I see the UTC Hour in the hour property. What version of the product are you using? On what operating system? 1.7 Windows XP Professional (Ver 2002, sp 3) Please provide any additional information below. I believe this will fix the issue.. In fromString() Change... var utc:Number = Date.UTC(year, month-1, date, hour, minutes, seconds, milliseconds); To... var utc:Number = Date.UTC(year, month-1, date, hour - (multiplier*offsetHours), minutes, seconds, milliseconds); In toString() Change... var date:Number = d.getUTCDate(); var month:Number = d.getUTCMonth(); var hours:Number = d.getUTCHours(); var minutes:Number = d.getUTCMinutes(); var seconds:Number = d.getUTCSeconds(); var milliseconds:Number = d.getUTCMilliseconds(); To... var date:Number = d.getDate(); var month:Number = d.getMonth(); var hours:Number = d.getHours(); var minutes:Number = d.getMinutes(); var seconds:Number = d.getSeconds(); var milliseconds:Number = d.getMilliseconds(); Do not use getUTC properties because the string should contain the local time. I think that should fix the issues. Thanks, Scott
Nov 15, 2010
Project Member
#1
alex.id....@gmail.com
Status:
Accepted
Nov 15, 2010
(No comment was entered for this change.)
Labels:
Milestone-1.7.2
Jan 9, 2011
(No comment was entered for this change.)
Labels:
-Milestone-1.7.2
Mar 30, 2011
(No comment was entered for this change.)
Labels:
-Priority-Medium Priority-Low
Oct 11, 2011
Be careful with timezones. We got very strange behaviours with offsets, especially the timezone have a summertime. Look for: https://bugs.adobe.com/jira/browse/SDK-31544 |