Check if 24 hours have passed (reading from a string)

后端 未结 4 1969
醉话见心
醉话见心 2021-01-28 04:37

I am saving date\'s in a file in the following format as a string.

Sat Jul 21 23:31:55 EDT 2012

How can I check if 24 hours have passed? I am a

4条回答
  •  忘掉有多难
    2021-01-28 05:11

    I would suggest storing your information as a java.util.Calendar which has a compareTo ()function.

    If you want to compare now to current time, you can use System.getCurrentTimeMillis() to get the current time.

提交回复
热议问题