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
Post a Comment