php 时间数据转换为时间戳代码
要做时间数据转换为时间戳我们利用php教程自带函数,strtotime() 函数将任何英文文本的日期时间描述解析为 Unix 时间戳.
strtotime("Fri Aug 05 12:19:04 +0800 2011");
strtotime("2011-02-01");
其它参考:
<?php echo ( strtotime ( "now" )); echo ( strtotime ( "3 October 2005" )); echo ( strtotime ( "+5 hours" )); echo ( strtotime ( "+1 week" )); echo ( strtotime ( "+1 week 3 days 7 hours 5 seconds" )); echo ( strtotime ( "next Monday" )); echo ( strtotime ( "last Sunday" )); ?> /* 输出: 1138614504 1128290400 1138632504 1139219304 1139503709 1139180400 1138489200 */查看更多关于php 时间数据转换为时间戳代码 - php日期的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did29194