You can use the Date object to compare two dates.
To compare today’s date with a specific date do the following:
var a=new Date();
a.setFullYear(YYYY,MM,DD);
var tod = new Date();
if (a>today)
{
alert("This is a later date");
}
else
{
alert("This is a previous date");
}
Comparing two Dates in JavaScript
You can use the Date object to compare two dates.
To compare today’s date with a specific date...
comparing two dates javascript
Also tagged with one or more of these keywords: comparing two dates, javascript
Web Design →
Javascript →
Comparing Strings in JavaScriptStarted by Salwa, 18 Jul 2013 comparing strings, javascript |
|
|
||
Web Design →
Javascript →
Using OnSubmit in JavaScriptStarted by Salwa, 18 Jul 2013 javascript, onsubmit event |
|
|
||
Web Design →
Javascript →
Downloading Javascript to iPodStarted by OneDes, 13 Jun 2013 downloading, javascript, to ipod |
|
|
||
Web Design →
Javascript →
Downloading JavaScript to BlackBerryStarted by OneDes, 13 Jun 2013 downloading, javascript and 1 more... |
|
|
||
Web Design →
Javascript →
Enabling JavaScript on a MacStarted by OneDes, 13 Jun 2013 enable, javascript, mac |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users