当前位置:Gxlcms > 数据库问题 > mysql 时间,时间戳,字符串之间相互转换

mysql 时间,时间戳,字符串之间相互转换

时间:2021-07-01 10:21:17 帮助过:12人阅读

时间转字符串

date_format(now(),‘%Y-%m-%d‘)

时间转时间戳

unix_timestamp(now())

字符串转时间

str_to_date(‘2020-01-19‘,‘%Y-%m-%d %H‘)

字符串转时间戳

unix_timestamp(‘2020-01-19‘)

时间戳转字符串

from_unixtime(1579422064202,‘%Y-%d‘)

时间戳转时间

from_unixtime(1579422064202)

mysql 时间,时间戳,字符串之间相互转换

标签:format   amp   str   date   相互转换   to_date   时间戳   转换   from   

人气教程排行