Posted by Gordon Burditt on 01/15/06 22:37
>I have a timestamp field in a mysql DB and I want to know how much time
>has past since that timestamp.
>
>is it possible?
Yes. Use MySQL to do it.
>Say that I have this value in a variable -
>1) how do I get the current system timestamp?
now()
>2) how do I subtract the first from the second?
timestampdiff(). (requires MySQL 5.0 or greater).
timediff(), but it returns the value in hours, minutes, and seconds.
datediff(), but only the date parts are used.
Gordon L. Burditt
[Back to original message]
|