Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Comparision of Time  RSS feed

 
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: 42972
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!