You can check if the locale takes DST into account by compare the offsets of a winter day with a summer day. If they are the same the locale doesn't care about DST.
If not, I would need to fix my alarm clock ;)

On 22/04/2009, at 10:12 PM, Keith Reinfeld wrote:

Pedro,


To calculate the time elsewhere you have to factor-in the local machine's
timezone offset value.
I worked out the following for my World Clock last year:

<snip>
// Local Time
var lDate:Date = new Date();
// Elsewhere Time: London Standard Time: 0, DST: 1
var utcH:Number = 1;
var utcM:Number = 0;
var wDate:Date = new Date(lDate.getTime() + (lDate.getTimezoneOffset() *
1000 * 60) + (utcH * 1000 * 60 * 60) + (utcM * 1000 * 60));
trace("wDate = "+wDate);
</snip>

Note:
The GMT value in the trace will still reflect the local machine's timezone.
Just ignore it. The important data are the time and date.

Going forward you will want to consider the issues presented by Daylight
Saving Time:
Does the locale of the local machine observe DST?
Is the locale of the local machine currently in DST?
Do they observe DST in the designated Elsewhere?
Is the designated Elsewhere currently in DST?

Regards,

-Keith
http://keithreinfeld.home.comcast.net



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to