RE: [Flashcoders] UK time clock

2009-04-22 Thread Keith Reinfeld
 
> 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.
 
That is true. More precisely you can compare the timezone offset of January
1st to July 1st. 
 
If they are equal DST is not observed. 
 
If the January timezone offset is greater than July's the local machine is
in the northern hemisphere. 
 
If the July timezone offset is greater than January's the local machine is
in the southern hemisphere. 
 
Which helps a lot when you are ready to determine whether DST is in effect. 
 
Regards, 

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


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


Re: [Flashcoders] UK time clock

2009-04-22 Thread Hans Wichman
or use something like this:

*http://www.earthtools.org/timezone-1.1/39.96/5.6250*


On Wed, Apr 22, 2009 at 10:29 PM, Weyert de Boer  wrote:

> 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:
>>
>> 
>> // 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);
>> 
>>
>> 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
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] UK time clock

2009-04-22 Thread Weyert de Boer
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:


// 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);


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


RE: [Flashcoders] UK time clock

2009-04-22 Thread Keith Reinfeld
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:  

 
// 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); 
 
 
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


Re: [Flashcoders] UK time clock

2009-04-22 Thread Pedro Kostelec
>
> THanks. I'll check getTimezonOffset().
>
I thought it was going to be harder than that.

Pedro Kostelec
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] UK time clock

2009-04-22 Thread Nate Beck
Oh... also... to answer the original post.  You'll want to do something like
this:
1) Figure out what Timezone the current user's computer is set to.
 myDate.getTimezoneOffset();
2) The timezoneOffset is... "The minutes you need to add to the computer's
local time value to equal UTC. If your computer's time is set later than
UTC, the return value will be negative."
3) Calculate the offset (in minutes) between the clients timezone and your
target timezone.
4) Calculate your clock's values from there.

HTH,
Nate

On Wed, Apr 22, 2009 at 12:17 PM, Nate Beck  wrote:

> Timezones aren't supported in the Flash Player... you only have UTC time...
> and then it derives your "local time" based on your computers timezone
> offset.
> I've talked about this quite a bit on FlexCoders (second half of the
> conversation):
>
> http://www.nabble.com/flex-date-and-timezone-td21695609.html
>
>
> On Wed, Apr 22, 2009 at 11:40 AM, Pedro Kostelec wrote:
>
>> OH, there is a way to bring out zone related time in Flash? I only knew
>> the
>> way, that takes the time from the local computer. How'd you do it?
>> Any tutorial or script?
>>
>> On Wed, Apr 22, 2009 at 8:31 PM, Weyert de Boer 
>> wrote:
>>
>> > Ain't that the same as the UTC time? As far as I know UTC time is GMT
>> which
>> > is the UK time. Of course, you need to take the daylight saving into
>> > account.
>> >
>> > Winter: UTC+0 (UTC=GMT)
>> > Summer: UTC+1 (GMT+1)
>> >
>> >
>> >
>> > On Apr 22, 2009, at 8:16 PM, Pedro Kostelec wrote:
>> >
>> >  Hello
>> >> Is there a way to create a clock that would show UK time, regardless in
>> >> which time zone you are?
>> >>
>> >>
>> >> Thanks,
>> >>
>> >> Pedro Kostelec
>> >> ___
>> >> 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
>> >
>> ___
>> Flashcoders mailing list
>> Flashcoders@chattyfig.figleaf.com
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
>
> --
>
> Cheers,
> Nate
> 
> http://blog.natebeck.net
>
>
>


-- 

Cheers,
Nate

http://blog.natebeck.net
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] UK time clock

2009-04-22 Thread Weyert de Boer
Well, you can use get getTimezonOffset()-method which is the minutes  
different from the UTC/GMT time
For example, here in The Netherlands the offset should be 120mins.  
This means that the Date-object will
always return your so called zone-related time in Flash. After that  
you can remove the offset from the current time and then you get the  
UK or GMT/UTC time.


OH, there is a way to bring out zone related time in Flash? I only  
knew the

way, that takes the time from the local computer. How'd you do it?
Any tutorial or script?

On Wed, Apr 22, 2009 at 8:31 PM, Weyert de Boer   
wrote:


Ain't that the same as the UTC time? As far as I know UTC time is  
GMT which

is the UK time. Of course, you need to take the daylight saving into
account.

Winter: UTC+0 (UTC=GMT)
Summer: UTC+1 (GMT+1)



On Apr 22, 2009, at 8:16 PM, Pedro Kostelec wrote:

Hello
Is there a way to create a clock that would show UK time,  
regardless in

which time zone you are?


Thanks,

Pedro Kostelec
___
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


___
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


Re: [Flashcoders] UK time clock

2009-04-22 Thread Nate Beck
Timezones aren't supported in the Flash Player... you only have UTC time...
and then it derives your "local time" based on your computers timezone
offset.
I've talked about this quite a bit on FlexCoders (second half of the
conversation):

http://www.nabble.com/flex-date-and-timezone-td21695609.html


On Wed, Apr 22, 2009 at 11:40 AM, Pedro Kostelec wrote:

> OH, there is a way to bring out zone related time in Flash? I only knew the
> way, that takes the time from the local computer. How'd you do it?
> Any tutorial or script?
>
> On Wed, Apr 22, 2009 at 8:31 PM, Weyert de Boer  wrote:
>
> > Ain't that the same as the UTC time? As far as I know UTC time is GMT
> which
> > is the UK time. Of course, you need to take the daylight saving into
> > account.
> >
> > Winter: UTC+0 (UTC=GMT)
> > Summer: UTC+1 (GMT+1)
> >
> >
> >
> > On Apr 22, 2009, at 8:16 PM, Pedro Kostelec wrote:
> >
> >  Hello
> >> Is there a way to create a clock that would show UK time, regardless in
> >> which time zone you are?
> >>
> >>
> >> Thanks,
> >>
> >> Pedro Kostelec
> >> ___
> >> 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
> >
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 

Cheers,
Nate

http://blog.natebeck.net
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] UK time clock

2009-04-22 Thread Pedro Kostelec
OH, there is a way to bring out zone related time in Flash? I only knew the
way, that takes the time from the local computer. How'd you do it?
Any tutorial or script?

On Wed, Apr 22, 2009 at 8:31 PM, Weyert de Boer  wrote:

> Ain't that the same as the UTC time? As far as I know UTC time is GMT which
> is the UK time. Of course, you need to take the daylight saving into
> account.
>
> Winter: UTC+0 (UTC=GMT)
> Summer: UTC+1 (GMT+1)
>
>
>
> On Apr 22, 2009, at 8:16 PM, Pedro Kostelec wrote:
>
>  Hello
>> Is there a way to create a clock that would show UK time, regardless in
>> which time zone you are?
>>
>>
>> Thanks,
>>
>> Pedro Kostelec
>> ___
>> 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
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] UK time clock

2009-04-22 Thread Weyert de Boer
Ain't that the same as the UTC time? As far as I know UTC time is GMT  
which is the UK time. Of course, you need to take the daylight saving  
into account.


Winter: UTC+0 (UTC=GMT)
Summer: UTC+1 (GMT+1)


On Apr 22, 2009, at 8:16 PM, Pedro Kostelec wrote:


Hello
Is there a way to create a clock that would show UK time, regardless  
in

which time zone you are?


Thanks,

Pedro Kostelec
___
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


[Flashcoders] UK time clock

2009-04-22 Thread Pedro Kostelec
Hello
Is there a way to create a clock that would show UK time, regardless in
which time zone you are?


Thanks,

Pedro Kostelec
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders