This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes how to make different date format validation ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to make different date format validation ?" Watch "how to make different date format validation ?" New topic
Author

how to make different date format validation ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
hi, have a nice day, i try to create some validation for date with different date format , for example, i may have DD/mm/yyyy , mm/dd/yyy , and yyyy-mm-dd ,

when i get some dates string like different date format, how to i compare it with other , and get know of which one is larger ?

thank you very much for guidance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
how would you know if

13/01/2005 and 01/13/2005 is correct?

or if

01/02/2006 is January 2nd or Feb. 1st?

Eric
Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 438
the date string actually get from date-picker(calendar), and i set parameter of date format from property file, date format in property eventually get though from java code(jsp) and set the dateformat for calendar using scriptlet

for example , if property file set field like dateformat="MM/dd/yyyy" , then the date-picker(calendar) will display in this defined format and also the return value would be following the defined format as well
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
look at this example here that I posted a prototype, with a slight change, you can make it work for your code.

http://www.webdeveloper.com/forum/showthread.php?p=384325#post384325

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make different date format validation ?
 
Similar Threads
conversion of date
3 months
How to determine Data Format while we are getting Data from Excel Sheet
java.text.ParseException
how can i reformat a Date object