Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation need a timer from a specific date and time

    Hello, I'm new to ASP, and I'm making a web page for my son... He was born on september 15th 2005, at 3:04 EST. (9/15/05) I want to have a spot on the bottom of the page that says... "I'm xx hours, xx minutes, and xx seconds old"

    if anyone could help me with this that would be awesome!!!!

    Thanks,
    Kal

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This will give you the difference in seconds. Then you can manipulate the variable to break it down into hours, minutes and seconds.
    Code:
    Dim dBirth, tDiff
    dBirth = CDate("9/15/2005 3:04 PM")
    tDiff = datediff("s", dBirth, Now())
    Response.Write "<p>I am " & tDiff & " seconds old.</p>"


  •  

    Posting Permissions

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