• Post Reply Bookmark Topic Watch Topic
  • New Topic

Date comparison help  RSS feed

 
Gemini Moses
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please help me do this simple data comparison in java.


String dbDate = dateRetrivedFromOracleDB

if( dbDate + 15 minutes > sysdate)
condition 1
else
condition 2


Thanks!
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What class are you using to represent the Date? Is it this? You will have to go through its documentation and work out which methods add 15 minutes, and which methods return the milliseconds since 1st Jan 1970 as a long. Then you can compare the value with sysdate, which you can obtain from methods of the System class.

The rest is easy.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!