actionscript clock

  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Joined: Oct 12, 2004
  • Posts: 861
  • Loc: BKNY
  • Status: Offline

Post January 13th, 2005, 6:45 pm

just wondering... if i set up a clock on a site using
getHours
getMinutes
and
getSeconds
will it be basing the time on the server it's hosted on or on the time on the viewer's computer?

anyone?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 13th, 2005, 6:45 pm

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post January 15th, 2005, 11:11 am

The person looking at the movies' clock. ( clientside )

When you use myDate = new Date() to create a new date object it makes a connection to the users clock.

When you use any of the date objects methods, they format the milliseconds since 1970 returned from that connection for that query into your date/time. :D
Strong with this one, the sudo is.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Joined: Oct 12, 2004
  • Posts: 861
  • Loc: BKNY
  • Status: Offline

Post January 15th, 2005, 9:26 pm

thanks, jb...

now... is there any way to set it up so it works off a fixed time (like greenwich time or something)?
i'm tryin'a set up clocks with the times for different cities around the world and, considering that the user could be anywhere, well, it'd be impossible to do the calculations from her/his clock...
is there anyway to work it out from the server's clock or something?

thanks,
puck
  • Jaw
  • Graduate
  • Graduate
  • User avatar
  • Joined: Nov 08, 2004
  • Posts: 132
  • Loc: Minneapolis, MN
  • Status: Offline

Post January 15th, 2005, 10:13 pm

You may want to pull the info from an xml file on another site(maybe a weather.com). I would guess that you could have php read the xml from that server and pass it in to your flash document. Intheory it should work... I haven't tested it though.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post January 17th, 2005, 11:49 am

Flash has UTC time methods :wink: Open the reference panel (shift+F1) & navigate to book - Objects > Core > Date > Methods to see them all.
Code: [ Select ]
mDate = new Date();
trace(mDate.getUTCHours());
  1. mDate = new Date();
  2. trace(mDate.getUTCHours());
Strong with this one, the sudo is.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Joined: Oct 12, 2004
  • Posts: 861
  • Loc: BKNY
  • Status: Offline

Post January 17th, 2005, 5:44 pm

joebert, you are severely amazing.

peace be with you.

-puck
  • Jaw
  • Graduate
  • Graduate
  • User avatar
  • Joined: Nov 08, 2004
  • Posts: 132
  • Loc: Minneapolis, MN
  • Status: Offline

Post January 18th, 2005, 5:26 am

I second that. JoeBert, I had no idea that existed in flash. Nice Job.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 49 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.