mysql时间函数,字符串时间转成时间戳;时间戳转换成字符串

时间函数。
sql:
unix_timestamp($strdate); //把我们的字符串时间-》时间戳格式。

若 $strdate为空!则返回的是当前的时间戳!

FROM_UNIXTIME($intdate);//把我们的时间戳-》字符串。

在sql中如何获得当前的年月日,时分秒?

FROM_UNIXTIME(unix_timestamp());

update users set addtime=FROM_UNIXTIME(unix_timestamp()) where username=’jacky’ and password=’abc123′

发表评论

电子邮件地址不会被公开。