Birthday Calculators -

Discussion in 'Javascript' started by justme, Oct 15, 2005.

  1. justme

    justme Guest

    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.

    justme, Oct 15, 2005
    1. Advertisements

  2. justme

    RobG Guest

    The group faq:


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

    RobG, Oct 15, 2005
    1. Advertisements

  3. JRS: In article <>
    , dated Fri, 14 Oct 2005 17:18:19, seen in
    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

    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)
    Dr John Stockton, Oct 15, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.