| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi, I'm using Java 1.5. How do I check if a string is a valid date in the format of "YYYY-MM-DD"? Note that this string "2008-02-31" is not a valid date. Thanks for your help, - Dave |
|
#2
| |||
| |||
| On Wed, 27 Aug 2008 12:44:04 -0700, laredotornado wrote: > I'm using Java 1.5. How do I check if a string is a valid date in the > format of "YYYY-MM-DD"? Note that this string "2008-02-31" is not a > valid date. > SimpleDateFormat.parse() -- martin@ | Martin Gregorie gregorie. | Essex, UK org | |
|
#3
| |||
| |||
| Martin Gregorie wrote: > On Wed, 27 Aug 2008 12:44:04 -0700, laredotornado wrote: > >> I'm using Java 1.5. How do I check if a string is a valid date in the >> format of "YYYY-MM-DD"? Note that this string "2008-02-31" is not a >> valid date. >> > > SimpleDateFormat.parse() .... and see also DateFormat.setLenient() -- Eric.Sosman@sun.com |
|
#4
| |||
| |||
| On Wed, 27 Aug 2008 12:44:04 -0700 (PDT), laredotornado <laredotornado@zipmail.com> wrote, quoted or indirectly quoted someone who said : >I'm using Java 1.5. How do I check if a string is a valid date in the >format of "YYYY-MM-DD"? Note that this string "2008-02-31" is not a >valid date. See http://mindprod.com/jgloss/calendar.html See parse. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.