PDA

View Full Version : How to find tomorrow



Burgin
09-23-2012, 01:13 PM
I'm using a script that uses this code to tell me what today is...

var day=mydate.getDay()
What's the code for tomorrow?

vwphillips
09-23-2012, 02:23 PM
<!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>

jscheuer1
09-23-2012, 03:24 PM
var nextday = new Date();
nextday.setDate(nextday.getDate() + 1);
nextday = nextday.getDay();

Burgin
09-24-2012, 04:48 AM
Thanks

bernie1227
09-24-2012, 06:47 AM
@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?