• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

how to make different date format validation ?

 
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic