MYSQL - datetime to seconds

前端 未结 7 1692
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 01:40

I wasn\'t able to find out (googling, reading mysql reference manual) how to get value of DATETIME in seconds in MySQL.

I dont mean to extract secon

7条回答
  •  眼角桃花
    2020-12-09 01:55

    The function UNIX_TIMESTAMP(datetime) returns the unix time, which happens to be the number of seconds since 1-Jan-1970 0000 UTC. That may be what you need, but not if you're dealing with dates of birth, historical dates, or dates after 2037.

提交回复
热议问题