php FROM_UNIXTIME(CreateDate,'%Y-%m-%d %H:%i:%s')

mysql时间戳:
插入时间戳:
INSERT INTO comment(CreateDate,content)values(UNIX_TIMESTAMP(),'content')
取到时间戳:
SELECT content FROM_UNIXTIME(CreateDate,'%Y-%m-%d %H:%i:%s') as CreateDate FROM comment
%Y-%m-%d %H:%i:%s 表示:2008-12-25 18:23:33
UNIX_TIMESTAMP()和FROM_UNIXTIME(CreateDate,'%Y-%m-%d %H:%i:%s')配对

你可能感兴趣的:(PHP,mysql,unix)