Hello!
Can somebody make me a seconds_since function?
The parameters should be day, month and year, something like: seconds_since(day,month,year);... it will return the number of seconds ellapsed since the chosen data
It will be used something like this:
Messenger.MyPersonalMessage = "Today I life "+seconds_since(24,03,1990)+" seconds!";
or:
Messenger.MyPersonalMessage = "I'm 16 for "+seconds_since(24,03,2006)+" seconds!";
Thanks in advance
Got it! Here's the function:
code:
function seconds_since(day, month, year) {
var myDate=new Date();
myDate.setFullYear(year,month - 1,day);
var myDate2=new Date();
return Math.round((myDate2.getTime() - myDate.getTime()) / 1000);
}