aspose file tools*
The moose likes JDBC and the fly likes Comparing recorded date and current date in minutes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Comparing recorded date and current date in minutes" Watch "Comparing recorded date and current date in minutes" New topic
Author

Comparing recorded date and current date in minutes

Nikolas Bernadel
Greenhorn

Joined: Aug 09, 2012
Posts: 10

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

    Joined: Apr 20, 2011
    Posts: 237
        
        1

    This should be moved to the JDBC section.
    Campbell Ritchie
    Sheriff

    Joined: Oct 13, 2005
    Posts: 39409
        
      28
    Joel Christophel wrote:This should be moved to the JDBC section.
    Done.
    Nikolas Bernadel
    Greenhorn

    Joined: Aug 09, 2012
    Posts: 10

    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.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Comparing recorded date and current date in minutes