How can i do the calculation to get the time difference. I have both the time of the server and the time of the client system in isoDate date format. Here are the output data i have :
Server time which is in UTC converted to local sytem timezone time :
Tue May 22 2012 14:29:51 GMT+0530 (India Standard Time)
Local System Time :
Tue May 22 2012 14:31:51 GMT+0530 (India Standard Time)
I want to do the calculation in such a way that if the local system time is less then or greater then say 5 min (configurable value) ignoring the difference in seconds compared to what the server time is showing want to perform some task else another task. I dont know how to do the calculation because when it is midnight 12:01 am according to the server time then the date, hour and minute changes whereas if the local system is just 4 min behind how to determine the difference is not less then 5 min although the date changed. My main idea is to check everything to match date, time and check the difference. Please help.
Use:
or