Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparision of Time

 
jaya repaka
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have one date field.I am getting the time(hh:mm a) as
example: 10.30 PM I wanted to compare this time with hard coded value(8.30PM)
Is there way to compare two time(if(this time> hardcoded time)- 10.30PM > 8.30PM)..If there is a way please le me know..


Thanks in advance

Regards
lakshmi
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read this:

as
and throw a QuestionNotUnderstoodException.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have the dates as java.util.Date or java.util.Calendar objects, you can use the before() and after() methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic