...

View Full Version : Getting time difference



markhartnady
06-03-2004, 02:14 PM
Anyone know the function to compare two TIMESTAMPS (of 14 digits each) which will return the difference in seconds?

litebearer
06-03-2004, 04:43 PM
since timestamps are seconds. simply...



echo (timestamp1 - timestamp2);

markhartnady
06-03-2004, 04:46 PM
Not 14 digit MySQL timestamps... which is to what I am refering to.

They come in the following format:

YYYYMMDDHHMMSS

eg:

20040603164500

This is 3 June 2004, 4:45:00pm

litebearer
06-03-2004, 05:00 PM
here's a date-time class that may help you

http://sourceforge.net/projects/phpdatetime/



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum