Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to compare two dates in mm/dd/yyyy format  RSS feed

 
yogesh m gaikwad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"02/11/2013"
I have this date format and i want to check this date is < 05/11/2013
how can i do it???
please send me answer
i am waiting
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yogesh m gaikwad wrote:"02/11/2013"
I have this date format and i want to check this date is < 05/11/2013
how can i do it???
please send me answer
i am waiting

Hi yogesh,

Welcome to CodeRanch!

Here at CodeRanch, we encourage users to learn on their own - rather than providing ready-made answers.

Coming to your doubt, there are two methods in Date class: after and before. Both method accept a Date object and return boolean result.

So, it you are having two Date objects, then you can easily invoke these methods.

I hope this helps.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15859
80
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have those dates as strings? Then you'll first want to parse them into Date objects, using java.text.SimpleDateFormat.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!