Date and time conversion according to Zone using Flex3

1.4k Views Asked by At

i am sending the date and time in ( mm/dd/yyyy hh:mm) this format from india to australia( i am booking a date and time for future), for the user in australia it should show him according to his local time. As australia is 5 hrs and 30 mins past to india. how to do it using flex3.

2

There are 2 best solutions below

0
On

First, use the Date class. Second, use UTC values when sending dates (see getUTC family of methods). So when you receive a date, you'll know it is in UTC so you can set up a Date instance with those UTC values (see setUTC family of methods). The class will automatically do the timezone calculations for you and when you present it to the user it will be in their timezone.

2
On

Flex has no timezone calculation support built-in (you can get your local clock's offset and convert between UTC time and local time and that's basically it), your best bet would be to do the conversion via a server-call (with Joda handling the timezone calculations, which includes DST offsets).