Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 2007-09-28, 01:30 PM   #3
AndySvk
Internet! Is that thing still around?
 
Join Date: Sep 2007
Posts: 5
I am not sure if the above answer would work .. I think it does not ..
cause dayName[now.getDay()+8] would look for an item in array with index 8+ and there are just 7 days (indexes 0-6) so it would produce an error ..

you can rather use this simple code

Code:
<script>

// current date
var now = new Date();

// our new date
var newDate = new Date();

// let's move 3 days to past
newDate.setDate(now.getDate()-3);

// now let's add 5 hours
newDate.setHours(now.getHours()+5);

// we can add 2 months as well
newDate.setMonth(now.getMonth()+2);

</script>
I think you get the point ...
AndySvk is offline   Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:13 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc