File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Regarding Date functions in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Regarding Date functions in java" Watch "Regarding Date functions in java" New topic
Author

Regarding Date functions in java

Pravin Reddy
Greenhorn

Joined: Dec 01, 2004
Posts: 8
hi friends,

I am trying to read a file where date is in the form of string like
23-MAR-2004.

I want to check whether the string i.e., 23-MAR-2004 is valid date or not .. and if it is valid date.... i need to store in a variable.

Is there any function to check whether it is valid date or not? if not, any other way?

Bye
Pravin
Sripathi Krishnamurthy
Ranch Hand

Joined: Mar 07, 2005
Posts: 232
just for you

http://www.rgagnon.com/javadetails/java-0099.html
Srinivasa Raghavan
Ranch Hand

Joined: Sep 28, 2004
Posts: 1228
You can use the SimpleDateFormat class & parse this string. if it's not a valid date in the specified format you get an exception.


Thanks & regards, Srini
MCP, SCJP-1.4, NCFM (Financial Markets), Oracle 9i - SQL ( 1Z0-007 ), ITIL Certified
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Regarding Date functions in java
 
Similar Threads
UTC formatting
date format
is date valid
how to display all months of a particular year according to the following rule
Convert String to Date