Jump to content

MYSQL: UNIX_TIMESTAMP(time_col)?


justravis

Recommended Posts

If UNIX_TIMESTAMP() is called with a date argument, it returns the value of the argument as seconds since '1970-01-01 00:00:00' UTC. date may be a DATE string, a DATETIME  string, a TIMESTAMP, or a number in the format YYMMDD or YYYYMMDD.

 

"08:40:00" is a TIME string.

I haven't had the need to store just a time. It seems useless if it's not associated with a date as well. I'm sure there's a reason...

I do this sometimes, but not very often... even so, a TIME field is always the best choice vs TIMESTAMP.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.