File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Murach's Java Servlets and JSP this week in the Servlets 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: 9

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: 231
        
        1

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

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

    Joined: Aug 09, 2012
    Posts: 9

    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.
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Comparing recorded date and current date in minutes
     
    Similar Threads
    Calendar Class
    JavaMail and today's mails..
    Need help with how to involving calculations
    Working with Calendar class
    Display time in other timezones