php中UNIX时间戳与日期互相转换

1. UNIX时间戳转换为日期用函数: date() 

一般形式:date('Y-m-d H:i:s', 1156219870);
2. 日期转换为UNIX时间戳用函数:strtotime()
一般形式:strtotime('2010-03-24 08:15:42')

 

posted @ 2017-08-25 09:21  延吉宝  阅读(362)  评论(0编辑  收藏  举报
粤ICP备13013300号