java - How to determine if 48 hours has passed from a specific time? -



java - How to determine if 48 hours has passed from a specific time? -

i looking check , see if 48 hours has pasted specific time? using date time format (yyyy/mm/dd hh:mm:ss) there java function this?

sure. advice pick joda datetime.

but grab milliseconds 2 dates , subtract them. pass them hours , check if more 48 have passed.

// pseudo-code datetime = new datetime("old time"); datetime b = new datetime(" "); // hours double hours = (a.getmillis() - b.getmillis()) / 1000 / 60 / 60; if(hours>48) ...

java time

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -