php中unixtime与date相互转换
- php中unixtime与date相互转换
发布时间:2011-06-19 类别:PHP技术 来源:侠客工作室 -
- 1
- 2
- 3
- 4
- 5
- 将当前 unixtime 转换成当前的 年月日时分秒function makeTime(){$selectTime = time();return date("Y",$selectTime)."-".date("m",$selectTime)."-".date("d",$selectTime)." ".date("H",$selectTime).":".date("i",$selectTime).":".date("s",$selectTime);}将任何英文文本的日期时间描述解析为 Unix 时间戳echo strtotime("now"), "\n";
echo strtotime("10 September 2000"), "\n";
echo strtotime("+1 day"), "\n";
echo strtotime("+1 week"), "\n";
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime("next Thursday"), "\n";
echo strtotime("last Monday"), "\n";echo strtotime("2010-04-16 16:37:12"); - ☆☆☆技术交流群:5684178☆☆☆
- 上一篇:Maximum execution time of 30 seconds exceeded解决方法
- 下一篇:php汉字转换成拼音代码