Page 1 of 1

How to calculate the difference in milliseconds of two dates

Posted: Sun Nov 30, 2003 9:43 am
by caxibrema
How to calculate the difference in milliseconds of two dates??? :oops:

Posted: Sun Nov 30, 2003 11:52 am
by Stoker
what format do you have the dates in?
If they are in a unix timestamp like time() gives its just deduct and multiply, if it is in some literal format convert it to unixtime by using mktime() and then deduct and multiply..

Posted: Sun Nov 30, 2003 3:48 pm
by caxibrema
the dates are in the timestamp format of mysql yyyymmddhhMMss... what can i do?

Posted: Sun Nov 30, 2003 4:17 pm
by Stoker
if all dates are newer than january 1st 1970 you can do as I wrote, use mktime() to convert to unixtimestamp before subtracting and then multiplying...