Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 July 24th, 2007, 12:35 AM
Authorized User
 
Join Date: Apr 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to compare two dates

how to compare two dates(from- 04-Apr-04 & to-06-Jun-04) and alert user to pick from date < to date

 
Old September 3rd, 2007, 08:52 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi lakshmi!!
 plz check
 http://www.javascriptkit.com/javatut...fference.shtml

Steps:
1>split the dates using "-" and get the values of date,month ,year
2>based on Apr,Jun etc u can get the value of the month (u will need to put these Apr,May vaule in Array etc)
3>created Date object
4>use getTime function and substract from_dt -to_dt

Hope this will help you
Cheers!!


Cheers :)

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use the datediff function to compare dates cesemj VB How-To 0 June 9th, 2006 04:03 PM
How do I compare 2 dates? Lucy Classic ASP Basics 1 May 3rd, 2005 07:24 PM
Compare dates langer123 Classic ASP Basics 2 April 16th, 2005 08:57 AM
Compare dates [problem]... Varg_88 VB Databases Basics 3 August 20th, 2004 09:55 AM
Compare Dates in JS apd8x Javascript 4 June 16th, 2003 08:27 AM





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