The Artima Developer Community
Sponsored Link

Java Answers Forum
Date Comparison using Simple Date Format

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Will

Posts: 20
Nickname: lofty
Registered: Mar, 2005

Date Comparison using Simple Date Format Posted: Jan 4, 2006 1:10 PM
Reply to this message Reply
Advertisement
I'm trying to compare a given date with two user specified dates (earliest x and latest y) to see if the date is between x and y as supplied by the user.

I seem to be having a problem parsing a string into a date format to compare with the user supplied variables (presumably I'd get the same problem with the user supplied variables, but we don't get that far).

I'm taking the 'control' date, and the dates supplied by the user from strings using

Date controlDate = SimpleDateFormat.parse(suppliedDate);


I've tried specifying the date format, ie mm/dd/yyyy but I get an "unparseable date" exception each time.

Can anyone help me with this?
Thanks.

Topic: Struts with Ajax problem Previous Topic   Next Topic Topic: How to Recognise a Typed Key?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use