Forums Register Login

Comparing recorded date and current date in minutes

+Pie Number of slices to send: Send
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!
    +Pie Number of slices to send: Send
    This should be moved to the JDBC section.
    +Pie Number of slices to send: Send
     

    Joel Christophel wrote:This should be moved to the JDBC section.

    Done.
    +Pie Number of slices to send: Send
     

    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.
    A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
    a bit of art, as a gift, that will fit in a stocking
    https://gardener-gift.com


    reply
    reply
    This thread has been viewed 819 times.
    Similar Threads
    Need help with how to involving calculations
    Calendar Class
    Display time in other timezones
    Working with Calendar class
    JavaMail and today's mails..
    More...

    All times above are in ranch (not your local) time.
    The current ranch time is
    Mar 28, 2024 14:00:27.