Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2003, 09:37 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default When is two weeks later?

I need a way to retrieve the date and find out
what the date will be two weeks later.

Any suggestions?

Thanks
__________________
-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old November 28th, 2003, 01:52 AM
Authorized User
 
Join Date: Jun 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

//current date
var now=new Date();
//two weeks later
var then=now+(14*24*60*60*1000);


-Van
(Old dog learning new tricks...)
 
Old November 28th, 2003, 04:40 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Or if you think two weeks later is todays date plus 14:
Code:
var dt = new Date();
dt.setDate(dt.getDate() + 14);
alert(dt.toUTCString());
--

Joe





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ok 2 weeks of this and no I am braindead aasiddle ASP.NET 2.0 Basics 3 March 14th, 2007 10:36 PM
Working with weeks Vince_421 Access 5 January 30th, 2007 12:34 PM
Choose all records from 2 weeks ago?? morpheus Classic ASP Databases 4 January 9th, 2007 01:00 PM
Group by Weeks in a query or table lryckman Access VBA 4 December 4th, 2006 08:55 AM
weeks yula Crystal Reports 1 August 31st, 2006 11:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.