# Thread: age in seconds calculator?

1. Registered User
Join Date
Jul 2009
Posts
2

## age in seconds calculator?

hello everyone!!

i have a website and would like to have a "your age in seconds" calculator, and a "your weight in bags of sugar" calculator.
Thing is, i know nothing about programming javascript, in fact, it was a freind of mine who reccomended this site as he`d had assistance here before.
Can anyone help? or is there some kind of script already out there that i can use?

Thanks

Steve

2. Fon age in years to age in seconds (x in years, y in seconds)
y=x * 365*24*3600

Taking count of the number of leap years (n in days)
n=parseInt(x/4);

We end up with
y=parseInt(x*365.25*24*3600)

I hope this point you in the right direction?

3. Of course to be more exact you have to take into account the birthdate substracted from the current date

4. Age in seconds:
Code:
`(new Date() - new Date ('1 Jan 1970')) * 100`
And the date string can be in several, platform dependent formats.

5. Registered User
Join Date
Jul 2009
Posts
2
thanks for the replies, i have noted them down and will have a read up on how to actually put this code into a webpage.

cheers!!

steve

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•