SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2001
    Location
    Currently in Banjul, GAMBIA (West Africa)
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need some help with a date script....

    Hi... I am new here, first post actually, and I was hoping someone would be able to help me with a script I am trying to write.

    If I am doing this all wrong, it wouldn't be the first time. I am more of a cut and paste scripter, but I tried to do this one on my own...

    What I need is a script which will dynamically generate a date for an HTML page 3 days in advance. For example, today is the 3rd, so I need the script to say it is the 6th of October 2001....

    Here was my feeble attempt, if you can point me in the right direction or debug it for me, I would be very appreciative.

    -Xenon

  2. #2
    JavaScript Guru (Big Ego) Arielladog's Avatar
    Join Date
    Jul 1999
    Location
    SC, USA
    Posts
    390
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey,

    To get a date 3 days ahead of the current date, try this:

    x=new Date(new Date().getTime()+(1000*60*60*24*3))

    And x should not be a date object three days in advance:

    http://developer.netscape.com/viewso...ateobject.html

    aDog


Bookmarks

Posting Permissions

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