/ Published in: ActionScript 3
This should come in handy some day.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
cmpDat = new Array(2007, 12, 2, 0, 0, 0); /* year mon day hr min sec */ function compareDates(cmpDat){ var jd:Date = new Date(); var zd:Date = new Date(cmpDat[0], cmpDat[1]-1, cmpDat[2], cmpDat[3], cmpDat[4], cmpDat[5], 0); if(zd.getTime()<jd.getTime()){ return true; } else { return false; } } // the time is now? (true / false) if(compareDates(cmpDat)){ trace('ok das wars dann'); }
URL: http://snippets.dzone.com/posts/show/4735