in reply to calculating 24 hours ago with localtime

Hi,
just make it a TIMESTAMP field.
One of the good things about it is that if you do not explicitely it, it will be autmatically filled with the current time. Note that a MySQL timestamp is not a Unix Timestamp!
Regards,
svenXY
  • Comment on Re: calculating 24 hours ago with localtime

Replies are listed 'Best First'.
Re: calculating 24 hours ago with localtime
by b10m (Vicar) on Dec 09, 2005 at 14:07 UTC

    Whenever I have to work with MySQL, I avoid TIMESTAMP like the plague. I initially thought it was a bug, but it seems to be a "feature" to update the first TIMESTAMP column on an update (or insert).

    --
    b10m

    All code is usually tested, but rarely trusted.