Return to Snippet

Revision: 14577
at June 7, 2009 10:39 by stiobhart

Initial Code
// create variable dateNow with the current date 
var dateNow = new Date();

// create variable with specified date 
var dateBirthday = new Date(1987,2,22);

// create variable with date from number 
var dateFromNumber = new Date(543387600000);

// create variable with specified date+time 
var dateBirthTime = new Date(1987,2,22,1,32);

// find a difference between two dates EG. find the number of days til next NYE: 
// get current year, make date using that with December (month=11), day 31 
var NYEdate = new Date((new Date()).getFullYear(), 11, 31);
var nowdate = new Date(); 
// convert difference in milliseconds to days 
var nDiffDays = Math.floor((NYEdate - nowdate)/86400000);   

Initial URL

Initial Description
actionscript date object and some date calculations

Initial Title
actionscript - date object

Initial Tags
object, date, actionscript, flash

Initial Language