MySQL (Unix 时间戳、日期)转换函数:
MySQL (Unix 时间戳、日期)转换函数:
下面是示例:
- unix_timestamp(),
- unix_timestamp(date),
- from_unixtime(unix_timestamp),
- from_unixtime(unix_timestamp,format)
- select unix_timestamp(); — 1218290027
- select unix_timestamp(‘2008-08-08’); — 1218124800
- select unix_timestamp(‘2008-08-08 12:30:00’); — 1218169800
- select from_unixtime(1218290027); — ‘2008-08-09 21:53:47’
- select from_unixtime(1218124800); — ‘2008-08-08 00:00:00’
- select from_unixtime(1218169800); — ‘2008-08-08 12:30:00’
- select from_uixtime(1218169800, ‘%Y %D %M %h:%i:%s %x’); — ‘2008 8th August 12:30:00 2008’
上一篇:mysql中的update set select的使用方法
下一篇:没有了