• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Comparing recorded date and current date in minutes

 
Nikolas Bernadel
Greenhorn
Posts: 10
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm currently holding a specified date in a MySQL table in the format of "yyyy-MM-dd HH:mm:ss". I'd like to create a method that returns a boolean based on whether or not five minutes have passed since the recorded date.

The boolean would return true if:
  • The current date's minutes are surpass the recorded date's minutes
  • The recorded date's hours, day, month and year surpass the current date's


  • I'm not exactly sure as to how I'd go about this, so I'd appreciate some hints. Thanks!
     
    Joel Christophel
    Ranch Hand
    Posts: 250
    1
    Chrome Eclipse IDE
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    This should be moved to the JDBC section.
     
    Campbell Ritchie
    Sheriff
    Pie
    Posts: 48940
    60
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Joel Christophel wrote:This should be moved to the JDBC section.
    Done.
     
    Nikolas Bernadel
    Greenhorn
    Posts: 10
    Chrome Eclipse IDE Java
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Campbell Ritchie wrote:
    Joel Christophel wrote:This should be moved to the JDBC section.
    Done.

    Sorry for posting in the wrong forum. I thought the question wasn't really related to MySQL -- I apologize.

    Anyways, I've since solved my problem with JodaTime. The library can easily handle time and dates, which is exactly what I was looking for.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic