Birthday Calculators -

J

justme

Hi - can someone help me please?

I would like a countdown script which:

a) is presented as a form to the user
b) form has two date fields (today's date and upcoming event date)
c) results field, in which the difference calculated is displayed.

Results only need to be presented in DAYS format (i.e, don't need to
display hours, minutes, seconds etc..)

The second script I'm after, is a simple
calculation-of-seconds-since-birth script - also in displayed as a form
the user fills in their initial birth date/time details, results
displayed in a "You are ..... seconds old"

Thanking, in advance, anyone who can offer assistance.

Wendy
 
R

RobG

justme said:
Hi - can someone help me please?

I would like a countdown script which:

a) is presented as a form to the user
b) form has two date fields (today's date and upcoming event date)
c) results field, in which the difference calculated is displayed.

Results only need to be presented in DAYS format (i.e, don't need to
display hours, minutes, seconds etc..)

The second script I'm after, is a simple
calculation-of-seconds-since-birth script - also in displayed as a form
the user fills in their initial birth date/time details, results
displayed in a "You are ..... seconds old"

Thanking, in advance, anyone who can offer assistance.

The group faq:

<URL:http://www.jibbering.com/faq/>

provides a link that has everything you need for doing date calculations:

<URL:http://www.merlyn.demon.co.uk/js-dates.htm>
 
D

Dr John Stockton

JRS: In article <[email protected]>
, dated Fri, 14 Oct 2005 17:18:19, seen in
justme said:
Hi - can someone help me please?

I would like a countdown script which:

a) is presented as a form to the user
b) form has two date fields (today's date and upcoming event date)
c) results field, in which the difference calculated is displayed.

Results only need to be presented in DAYS format (i.e, don't need to
display hours, minutes, seconds etc..)

Use a method based on Zeller's Congruence or similar to convert Y M D to
a DayCount; and subtract. Or use Date Objects, subtract, divide by
864e5, and round to integer. Remember to validate the dates, if it
matters.

The second script I'm after, is a simple
calculation-of-seconds-since-birth script - also in displayed as a form
the user fills in their initial birth date/time details, results
displayed in a "You are ..... seconds old"

Cannot be done reliably. Javascript, like most OSs, has no knowledge of
Summer Time rules other than the current ones; and in most locations the
rules have changed since most people were born, or are about to change.
You'd need to know the moment of birth in UTC.

And they don't know about Leap Seconds either, so even UTC won't give
the right answer unaided.

Hoe many seconds old is a child born in Berlin on 2000-10-29 at 02:30
local time, if it's now whatever time it is at your (unspecified)
location?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top