Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

flash date comparison (See related posts)

// well it's flash ...
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');
}


You need to create an account or log in to post comments to this site.


Click here to browse all 5147 code snippets

Related Posts