• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • Last Modified:

Returning the time to a variable

I need to be able pass the current date/time to a variable using AS2 on Flash CS3.

cur_date = mmddyyyy hh mm ss

Kind of thing.

Thank you
0
Andy Brown
Asked:
Andy Brown
1 Solution
 
CyanBlueCommented:
Something like this???

CyanBlue
var now:Date = new Date();
trace(now.toString());
var now_str:String = now.getMonth() + 1 + "/" + now.getDate() + "/" + now.getFullYear() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds();
trace(now_str);

Open in new window

0
 
Andy BrownAuthor Commented:
Perfect - you're a star - really appreciated.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now