Results 1 to 5 of 5

Thread: How to find tomorrow

  1. #1
    Join Date
    Jan 2006
    Location
    Derbyshire, UK
    Posts
    74
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default How to find tomorrow

    I'm using a script that uses this code to tell me what today is...
    Code:
    var day=mydate.getDay()
    What's the code for tomorrow?

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,891
    Thanks
    2
    Thanked 441 Times in 435 Posts

    Default

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <title></title>
    </head>
    
    <body>
    <script  type="text/javascript">
    
    var mydate=new Date();
    var day=mydate.getDate();
    mydate=new Date(mydate.getFullYear(),mydate.getMonth(),mydate.getDate()+1,mydate.getHours(),mydate.getMinutes(),mydate.getSeconds());
    alert(mydate)
    
    </script>
    
    </body>
    
    </html>
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    var nextday = new Date();
    nextday.setDate(nextday.getDate() + 1);
    nextday = nextday.getDay();
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jan 2006
    Location
    Derbyshire, UK
    Posts
    74
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    Thanks

  5. #5
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    @vic, just out of curiosity, is there any particular reason that you got all parts of the date and only modifying one, than johns method of getting the one he wants to modify and modifying it?
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

Similar Threads

  1. Find the top 3
    By Sysmic Wave in forum MySQL and other databases
    Replies: 1
    Last Post: 07-23-2010, 03:12 PM
  2. Resolved How to find this js
    By bokanegro in forum JavaScript
    Replies: 7
    Last Post: 10-19-2008, 05:22 PM
  3. Replies: 1
    Last Post: 05-16-2008, 04:16 PM
  4. x,y find
    By midhul in forum JavaScript
    Replies: 8
    Last Post: 02-10-2008, 07:43 AM
  5. I can't find what I need
    By Brady in forum JavaScript
    Replies: 1
    Last Post: 03-07-2006, 03:40 PM

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
  •