This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes Javascript Date Check Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript Date Check" Watch "Javascript Date Check" New topic

Javascript Date Check

Sahil Sharma
Ranch Hand

Joined: Aug 27, 2003
Posts: 152
I have a textbox that contains date in this format DD-MON-YYYY.
Now i want to compare this with the current date to check that it should be less than the current date. How can i do so.
When i compare like this (dateentered is less than currentdate). Then results are not consistent. I think it is doing string comparison rather than date.

Eideo Guo

Joined: Aug 16, 2005
Posts: 29
you can use the Date object to compare,for instance:
I agree. Here's the link:
subject: Javascript Date Check