File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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
It's not a secret anymore!