Hey Gordon, you're on the right track.  Everything in the database is stored
as UTC.  However, here are two instances I ran into in the past where
timezone conversion needed to happen.

1) A scheduler in Seattle (PT) needs to create an event in a location that
is in a different timezone, let's say New Jersey (ET).  In this Flex
application, the scheduler uses a calendar control to create events
scheduled in "Activity local time".  So let's say the scheduler wants to
create an event for 3pm.

The problem with the Date class is that if he sets "3pm" it's in Pacific
time, when it is converted to UTC, it's going to be off by 3 hours from the
desired time.  The only way to make the software to work correctly would be
either add timezone knowledge to Flex, or do the timezone conversion on the
server.

The big problem with doing the conversion on the server, means that in your
request to the server you need to include the client local timezone offset
as well as the offset that the activity is occuring in.

2) A manager is tracking events in multiple locations in a Dashboard
application.  He wants to see the times in Activity local time.  Much like
looking at those screens at the airport.  Depature time is the depature
airport time, and arrival time is in arrival airport time.


The solution we ended up implementing was to monkey patch SchemaMarshaller
to accept a new type of class, DateTime.  DateTime is a proxy for Date,
which has an added method setTimezone.  Then we have a lazy loaded
dictionary which caches different timezone's information on an as needed
basis.
So this brings me back to my original statement... timezones are a hard
thing to implement.

Hope that makes sense.

Cheers,
Nate
 On Wed, Jan 28, 2009 at 10:22 PM, Gordon Smith <gosm...@adobe.com> wrote:

>    I haven't thought much about these issues (Not My Area of Expertise!)
> so I'm wondering…
>
>
>
> Assuming that your machine's timezone is always set correctly, doesn't the
> Player use that as the local timezone? Isn't there some easy way to
> translate this into Universal Time or whatever it's called for use on the
> back end? And then can't Flash clients in other time zones make the
> conversion to their local time zone based on their machine's timezone?
>
>
>
> What use cases require a client to do other kinds of timezone calculations?
> Calendaring apps?
>
>
>
> - Gordon
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Nate Beck
> *Sent:* Wednesday, January 28, 2009 11:17 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] flex date and timezone
>
>
>
> Timezones within Flex (or Flash in general) are a very VERY tricky thing to
> pull off.  I've been writing a DateTime proxy object that supports
> Timezones, and I now understand why the Flex team hasn't worked with
> Timezones yet.  They are a mess.
>
>
>
> Is the Timezone daylight savings? What about Arizona... they don't do
> daylight savings at all?
>
>
>
> So to be completely honest with you.  It's an extremely hard thing to do
> especially within the flash player itself.  The best way to get around it is
> to build an infastructure that uses java, .NET or some other language which
> has already done the work to support timezones, and then build a flex piece
> that can work with that.
>
> HTH,
>
> Nate
>
> On Wed, Jan 28, 2009 at 9:19 AM, Haykel BEN JEMIA <hayke...@gmail.com>
> wrote:
>
> You could probably use the tz database [
> http://www.twinsun.com/tz/tz-link.htm ]. Download the data archive [
> ftp://elsie.nci.nih.gov/pub/tzdata2009a.tar.gz ] which contains different
> files with time zone information. The file 'zone.tab' contains geographic
> coordinates for the principal locations of the zones (perhaps you can use
> this data). The other files contain time zone data (GMT offsets and other
> data). I think the 'Zone' entries are what you need.
>
> Haykel Ben Jemia
>
> Allmas
> Web & RIA Development
> http://www.allmas-tn.com
>
>
>
>
>
>  On Wed, Jan 28, 2009 at 5:42 PM, Gordon Smith <gosm...@adobe.com> wrote:
>
> > In java, there is a TimeZone class to handle it.
>
> > is there something similar in Flex?
>
>
>
> No, sorry, there isn't anything comparable in the Flex framework.
>
>
>
> Gordon Smith
>
> Adobe Flex SDK Team
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *coder3
> *Sent:* Tuesday, January 27, 2009 2:55 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* RE: [flexcoders] flex date and timezone
>
>
>
>
> Right. I only have the string. In java, there is a TimeZone class to handle
> it. is there something similar in Flex?
>
> Ryan Graham-3 wrote:
> >
> >
> > If you have access to the GMT offsets, sure. Otherwise, if you have just
> > the strings, I don't see an easy way...
> >
> >
> >
> > HTH,
> >
> > Ryan
> >
> >
> >
> > From: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com> [mailto:
> flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>] On
> > Behalf Of coder3
> > Sent: Tuesday, January 27, 2009 3:13 PM
> > To: flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] flex date and timezone
> >
> >
> >
> >
> > Hi All
> >
> > i have 3 timezone strings, for example, "America/Thule",
> > "Indian/Maldives",
> > and "Europe/Luxembourg". is there a way to sort them from east to west?
> >
> > thanks!!
> > c
> > --
> > View this message in context:
> > http://www.nabble.com/flex-date-and-timezone-tp21695609p21695609.html
> > Sent from the FlexCoders mailing list archive at Nabble.com.
> >
> >
> >
> >
> >
> > This message is private and confidential. If you have received it in
> > error, please notify the sender and remove it from your system.
> >
>
> --
> View this message in context:
> http://www.nabble.com/flex-date-and-timezone-tp21695609p21696340.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
>
>
>
>
>
> --
>
> Cheers,
> Nate
> ----------------------------------------
> http://blog.natebeck.net
>
>  
>



-- 

Cheers,
Nate
----------------------------------------
http://blog.natebeck.net

Reply via email to