Welcome to WebmasterWorld Guest from 54.161.175.236

Forum Moderators: open

Message Too Old, No Replies

User independent flash clock

Independent from user OS time

     
5:40 pm on Jul 12, 2007 (gmt 0)

New User

10+ Year Member

joined:May 17, 2005
posts:28
votes: 0


I am trying to do a clock in flash that is independent from the user's operating system time.

I am passing it a unix timestamp as a parameter from the server and creating an instance of the Date object. The time zone of the user is not important since the clock would always show time in New York, or London, or Los Angeles, or ...

The problem is that if the user has got the time bad on his computer, maybe 15 mins ahead, then the flash clock will also be 15 mins off.

Any suggestions?

Jon

2:08 pm on July 16, 2007 (gmt 0)

New User

5+ Year Member

joined:July 16, 2007
posts:2
votes: 0


this is an easy one. In your actionScript you want to use the getUTCHours() instead of getHours(). This will return universal time and universal minutes, so it will operate independently from the users machine.