Welcome to my actionscript snippet library!

Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.  

Get Current Date


var currentDate=new Date();
var month=currentDate.getMonth();
var day=currentDate.getDate();
var year=currentDate.getFullYear();

trace(month+"-"+ day + "-" + year);

1 comments:

Tiuipuv said...

Is there a way to add a current time ?
this doesnt work:
var currentDate = new Date();
var currentTime = new Time();
var month = currentDate.getMonth();
var day = currentDate.getDate();
var year = currentDate.getFullYear();
var time = currentTime.getTime();
trace(month + "/" + day + "/" + year + " at " + time);
I hope you find this comment lol

Post a Comment