War Room

Go Back   WarriorForum - Internet Marketing Forums > The Warrior Forum > Main Internet Marketing Discussion Forum

Featured Warrior Special Offer...
"Members Of The *War Room* Discover Secrets To Immediate Success!"
Reply
 
LinkBack Thread Tools
Old 03-31-2009, 02:00 PM   #1
Advanced Warrior
 
George Chernikov's Avatar
 
Join Date: Jan 2007
Location: Geneva, Switzerland
Posts: 685
Thanks: 65
Thanked 6 Times in 6 Posts
Contact Info
Send a message via Skype™ to George Chernikov
Default Help With JavaScript Needed - Tomorrow's Date

Hi all,

I'm having enormous trouble with JavaScript (possibly because I don't know the first thing about it).

I'm using a short script to display tomorrow's date (which changes dynamically whenever you visit the site). The code is as follows:

Code:
<script>
var tomorrow = new Date ();
tomorrow.setDate (tomorrow.getDate() + 1)
document.write(tomorrow + ". ");
</script>
It gets the job done - but it displays the date in its entirety, including the time - for example: Wed Apr 01 2009 21:00:23 GMT+0200 (Romance Daylight Time).

What I'm trying to do is to get it to display just the day (e.g., April 1, 2009).

Any idea how to do that?

Recession Job Hunter Blog - How to Find Paying Jobs in the Middle of the Economic Meltdown!
George Chernikov is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2009, 04:11 PM   #2
Banned
 
Join Date: Mar 2009
Location: florida
Posts: 44
Thanks: 0
Thanked 3 Times in 2 Posts
Default Re: Help With JavaScript Needed - Tomorrow's Date

Have you done a google search for javascript tutorials
Sylvan Noel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2009, 04:44 PM   #3
Yes that's my true photo
War Room Member
 
Janet Sawyer's Avatar
 
Join Date: Sep 2003
Location: Stockport, United Kingdom.
Posts: 1,457
Thanks: 38
Thanked 48 Times in 42 Posts
Default Re: Help With JavaScript Needed - Tomorrow's Date

Add days to DateTime using Java Script - Stack Overflow

Hope that helps.

Janet Sawyer is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following User Says Thank You to Janet Sawyer For This Useful Post:
Old 03-31-2009, 05:35 PM   #4
Advanced Warrior
 
George Chernikov's Avatar
 
Join Date: Jan 2007
Location: Geneva, Switzerland
Posts: 685
Thanks: 65
Thanked 6 Times in 6 Posts
Contact Info
Send a message via Skype™ to George Chernikov
Default Re: Help With JavaScript Needed - Tomorrow's Date

Janet,

Thanks a lot - this script works, but I still have the problem with the result being displayed as: Wed Apr 01 2009 21:00:23 GMT+0200 (Romance Daylight Time).

Is there a way to make it show April 1, 2009, rather than the whole long thing (it looks hideous)?

Recession Job Hunter Blog - How to Find Paying Jobs in the Middle of the Economic Meltdown!
George Chernikov is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2009, 06:16 PM   #5
Advanced Warrior
 
George Chernikov's Avatar
 
Join Date: Jan 2007
Location: Geneva, Switzerland
Posts: 685
Thanks: 65
Thanked 6 Times in 6 Posts
Contact Info
Send a message via Skype™ to George Chernikov
Default Re: Help With JavaScript Needed - Tomorrow's Date

Never mind, got it - all it took was the following:

Code:
document.write(tomorrow.toLocaleDateString());

Recession Job Hunter Blog - How to Find Paying Jobs in the Middle of the Economic Meltdown!
George Chernikov is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-31-2009, 06:51 PM   #6
HyperActive Warrior
 
Join Date: Mar 2009
Posts: 423
Blog Entries: 9
Thanks: 61
Thanked 76 Times in 63 Posts
Default Re: Help With JavaScript Needed - Tomorrow's Date

Can a moderator please move this to the Programming forum?

Regards,
Allen

Success only requires four words. http://www.warriorforum.com/blogs/ad...our-words.html

Adaptive is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > The Warrior Forum > Main Internet Marketing Discussion Forum

Tags
date, javascript, needed, tomorrow

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 07:33 PM.