<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Confusing TimeZone Offset Functionality in Flex</title>
	<atom:link href="http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/feed/" rel="self" type="application/rss+xml" />
	<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/</link>
	<description>Custom Software</description>
	<lastBuildDate>Wed, 16 May 2012 18:14:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Eric</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-4408</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Wed, 14 Sep 2011 22:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-4408</guid>
		<description>In all the conversations about dates in Flex I do not see much, if anything, about daylight savings time.

Here is a (simple?) problem: 

First I have a user that is in hypothetical time zone A.  This time zone has a spring forward daylight savings change on March 11/2012 @ 02:00. This means that there are only 23 hours in that day where 02:00 does not exist.

Assume the application has 24 hourly values to display for that day:

March 11th 00:00 value 0
March 11th 01:00 value 1
March 11th 02:00 value 2
...
March 11th 21:00 value 21
March 11th 22:00 value 22
March 11th 23:00 value 23

Assume also that the data above is stored in the database as UTC and some magic is applied to convert the date so that a normal hour displays correctly (e.g. May 5th 15:00 UCT in the database shows up as May 5th 15:00 in the users browser/time zone).

The question is: How do you display all 24 hours in that user’s browser?  If you haven’t taken this scenario into account, what likely happens is the 24 hours are displayed but the hour/value pairs get out of step at the time change and the last hour bleeds into the next day:

March 11th 00:00 value 0
March 11th 01:00 value 1
March 11th 03:00 value 2 (notice that at this point the value is out of step with the hour)
...
March 11th 22:00 value 21
March 11th 23:00 value 22
March 12th 00:00 value 23 (the 24th hour falls on the next day)

Has anyone encountered this issue and addressed it?</description>
		<content:encoded><![CDATA[<p>In all the conversations about dates in Flex I do not see much, if anything, about daylight savings time.</p>
<p>Here is a (simple?) problem: </p>
<p>First I have a user that is in hypothetical time zone A.  This time zone has a spring forward daylight savings change on March 11/2012 @ 02:00. This means that there are only 23 hours in that day where 02:00 does not exist.</p>
<p>Assume the application has 24 hourly values to display for that day:</p>
<p>March 11th 00:00 value 0<br />
March 11th 01:00 value 1<br />
March 11th 02:00 value 2<br />
&#8230;<br />
March 11th 21:00 value 21<br />
March 11th 22:00 value 22<br />
March 11th 23:00 value 23</p>
<p>Assume also that the data above is stored in the database as UTC and some magic is applied to convert the date so that a normal hour displays correctly (e.g. May 5th 15:00 UCT in the database shows up as May 5th 15:00 in the users browser/time zone).</p>
<p>The question is: How do you display all 24 hours in that user’s browser?  If you haven’t taken this scenario into account, what likely happens is the 24 hours are displayed but the hour/value pairs get out of step at the time change and the last hour bleeds into the next day:</p>
<p>March 11th 00:00 value 0<br />
March 11th 01:00 value 1<br />
March 11th 03:00 value 2 (notice that at this point the value is out of step with the hour)<br />
&#8230;<br />
March 11th 22:00 value 21<br />
March 11th 23:00 value 22<br />
March 12th 00:00 value 23 (the 24th hour falls on the next day)</p>
<p>Has anyone encountered this issue and addressed it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-2139</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 28 Feb 2011 04:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-2139</guid>
		<description>Thanks for the links, it&#039;s interesting to see there are other people with the same concerns.  Gracias!</description>
		<content:encoded><![CDATA[<p>Thanks for the links, it&#8217;s interesting to see there are other people with the same concerns.  Gracias!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Problema com Datas no Flash Player (Flex) at Como faço isso?</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-2099</link>
		<dc:creator>Problema com Datas no Flash Player (Flex) at Como faço isso?</dc:creator>
		<pubDate>Tue, 22 Feb 2011 19:47:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-2099</guid>
		<description>[...] 2) http://flexblog.faratasystems.com/2008/02/05/flex-local-datestime-transfer-issue 3) http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/ 4) http://www.cftips.net/post.cfm/flex-time-zone-management 5) [...]</description>
		<content:encoded><![CDATA[<p>[...] 2) <a href="http://flexblog.faratasystems.com/2008/02/05/flex-local-datestime-transfer-issue" rel="nofollow">http://flexblog.faratasystems.com/2008/02/05/flex-local-datestime-transfer-issue</a> 3) <a href="http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/" rel="nofollow">http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/</a> 4) <a href="http://www.cftips.net/post.cfm/flex-time-zone-management" rel="nofollow">http://www.cftips.net/post.cfm/flex-time-zone-management</a> 5) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-2009</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Wed, 09 Feb 2011 08:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-2009</guid>
		<description>Hey Agustin, basically you have two choices:

1. keep the dates with the correct UTC time and extend all the display components to be timezone aware.  depending on your app this could be a ton of work.

2. store the dates incorrectly (ie ignore timezone completely) and store the timezone in a separate field (if you need it).  This really only creates an issue when data goes to/from the server so that is the main problem you then need to solve.

I decided to go with #2 because, even if you re-write all the display classes, you still have no clue what timezone you are dealing with when the data goes to the server.  You know the UTC time but you have no idea what timeZone people want to see.

I wrote an adapter class that all data goes through whenever it goes to/from the server.  It looks for any dates and reverses the timezone offset that is on the client.  In other words, 3pm in the local timezone gets converted to 3pm UTC.  (we convert everything to UTC because that is the timezone of our server)

The server saves the 3PM, however it doesn&#039;t save timezones so it just gets saves as plain old 3PM with timezone not specified.  When if need the timezone we save it as text in a separate field.

When data comes back from the server of course it is 3PM UTC which is wrong, so you just re-apply the offset to bring it back to 3PM local time.

In other words, it is always saved as 3PM everywhere.

To figure out how to convert to/from UTC, create a dummy Date object and then use date.timezoneOffset to tell you how many hours to add/subtract.

This solution, of course, it is only useful when everybody wants to see the same thing on their client, ie everybody wants to see 3PM.  If people want things converted into their own time then Flex already works as-is.  (i think it&#039;s stupid though!)</description>
		<content:encoded><![CDATA[<p>Hey Agustin, basically you have two choices:</p>
<p>1. keep the dates with the correct UTC time and extend all the display components to be timezone aware.  depending on your app this could be a ton of work.</p>
<p>2. store the dates incorrectly (ie ignore timezone completely) and store the timezone in a separate field (if you need it).  This really only creates an issue when data goes to/from the server so that is the main problem you then need to solve.</p>
<p>I decided to go with #2 because, even if you re-write all the display classes, you still have no clue what timezone you are dealing with when the data goes to the server.  You know the UTC time but you have no idea what timeZone people want to see.</p>
<p>I wrote an adapter class that all data goes through whenever it goes to/from the server.  It looks for any dates and reverses the timezone offset that is on the client.  In other words, 3pm in the local timezone gets converted to 3pm UTC.  (we convert everything to UTC because that is the timezone of our server)</p>
<p>The server saves the 3PM, however it doesn&#8217;t save timezones so it just gets saves as plain old 3PM with timezone not specified.  When if need the timezone we save it as text in a separate field.</p>
<p>When data comes back from the server of course it is 3PM UTC which is wrong, so you just re-apply the offset to bring it back to 3PM local time.</p>
<p>In other words, it is always saved as 3PM everywhere.</p>
<p>To figure out how to convert to/from UTC, create a dummy Date object and then use date.timezoneOffset to tell you how many hours to add/subtract.</p>
<p>This solution, of course, it is only useful when everybody wants to see the same thing on their client, ie everybody wants to see 3PM.  If people want things converted into their own time then Flex already works as-is.  (i think it&#8217;s stupid though!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Agustin Pelliza</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-2004</link>
		<dc:creator>Agustin Pelliza</dc:creator>
		<pubDate>Tue, 08 Feb 2011 21:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-2004</guid>
		<description>Hi Jason, 
I&#039;m involved with this same issue and also at an already built project. Could you give any advice on how to manage this without refactoring the hole code? Me too get into trying to override Date&#039;s default behavior and couldn&#039;t. I do also think on extending DateFormatters to add this functionality, but I&#039;m wondering if there is any cleaner work around, since managing this logic at the view doesn&#039;t seems right to me.
Thanks on advanced.</description>
		<content:encoded><![CDATA[<p>Hi Jason,<br />
I&#8217;m involved with this same issue and also at an already built project. Could you give any advice on how to manage this without refactoring the hole code? Me too get into trying to override Date&#8217;s default behavior and couldn&#8217;t. I do also think on extending DateFormatters to add this functionality, but I&#8217;m wondering if there is any cleaner work around, since managing this logic at the view doesn&#8217;t seems right to me.<br />
Thanks on advanced.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philoo</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-1923</link>
		<dc:creator>Philoo</dc:creator>
		<pubDate>Thu, 27 Jan 2011 03:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-1923</guid>
		<description>Same problem here. Just voted, but the bug has been here for almost 3 years. Which evangelist can we ping to get an answer?</description>
		<content:encoded><![CDATA[<p>Same problem here. Just voted, but the bug has been here for almost 3 years. Which evangelist can we ping to get an answer?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Problema com Datas no Flash Player (Flex) &#171; Como faço isso?</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-967</link>
		<dc:creator>Problema com Datas no Flash Player (Flex) &#171; Como faço isso?</dc:creator>
		<pubDate>Wed, 20 Oct 2010 22:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-967</guid>
		<description>[...] 2) http://flexblog.faratasystems.com/2008/02/05/flex-local-datestime-transfer-issue 3) http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/ 4) http://www.cftips.net/post.cfm/flex-time-zone-management 5) [...]</description>
		<content:encoded><![CDATA[<p>[...] 2) <a href="http://flexblog.faratasystems.com/2008/02/05/flex-local-datestime-transfer-issue" rel="nofollow">http://flexblog.faratasystems.com/2008/02/05/flex-local-datestime-transfer-issue</a> 3) <a href="http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/" rel="nofollow">http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/</a> 4) <a href="http://www.cftips.net/post.cfm/flex-time-zone-management" rel="nofollow">http://www.cftips.net/post.cfm/flex-time-zone-management</a> 5) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Girijesh Kaushik</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-878</link>
		<dc:creator>Girijesh Kaushik</dc:creator>
		<pubDate>Sat, 18 Sep 2010 17:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-878</guid>
		<description>Voted/annoyed.</description>
		<content:encoded><![CDATA[<p>Voted/annoyed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-668</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Mon, 22 Mar 2010 20:09:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-668</guid>
		<description>hey jd - flex gets its information from the system clock however as far as I can tell there&#039;s no way to get the timezone code.  The best you can do is get the UTC offset.  If you have the UTC offset you can usually deduce the timezone if you know what country the user is in.</description>
		<content:encoded><![CDATA[<p>hey jd &#8211; flex gets its information from the system clock however as far as I can tell there&#8217;s no way to get the timezone code.  The best you can do is get the UTC offset.  If you have the UTC offset you can usually deduce the timezone if you know what country the user is in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JD</title>
		<link>http://verysimple.com/2009/11/16/confusing-timezone-offset-functionality-in-flex/#comment-667</link>
		<dc:creator>JD</dc:creator>
		<pubDate>Mon, 22 Mar 2010 19:08:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.verysimple.com/blog/?p=427#comment-667</guid>
		<description>Can Flex even deduce the &quot;local&quot; timezone in terms of EDT,CDT,PDT ... and so forth.</description>
		<content:encoded><![CDATA[<p>Can Flex even deduce the &#8220;local&#8221; timezone in terms of EDT,CDT,PDT &#8230; and so forth.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

