|
Posted by d on 09/28/42 11:37
"Super Mango" <liebermann@gmail.com> wrote in message
news:1137344888.413098.327320@o13g2000cwo.googlegroups.com...
> Hi everubody,
>
> 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?
> Say that I have this value in a variable -
> 1) how do I get the current system timestamp?
> 2) how do I subtract the first from the second?
>
> Thanks!
If you're going to be doing the vast majority of your time maths outside
MySQL, you might want to use integers instead of timestamps - you can just
save the unix timestamp in the database, which saves time converting between
MySQL and unix times. And, of course, you can still search/sort using the
unix timestamp...
Navigation:
[Reply to this message]
|