calculating NOW()-timestamp

admin

Administrator
Staff member
I'm trying to calculate time in MySQL.

There's a timestamp(14) row called "last_access" in my table and I'm trying to get the seconds between now and that timestamp.

Like this it works fine:
UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(last_access)

but why wouldn't this work?:
NOW()-last_access

This returns some weird value (on the same day: /100=seconds, on another day it's a way too high value!)

philip
 
Back
Top