PHP时间和日期函数详解
(编辑:jimmy 日期: 2026/8/20 浏览:3 次 )
PHP中所有函数都是UNIX纪元的,即从1970年1月1日开始的。
日期是从这个时候开始的秒数。
当一个函数调用从这时候计的秒数时,就把它当作(timestamp)时间戳。
本地时间函数
1. string date(string format,inieger timestamp)
该函数返回一个表示时间的字符串,是由string format 控制的。
如:
<"Y年 m月d日");//输出当前,年月日.
print(date("Y年 m月d日",60*60*24*365*10);//输出1980年1月1日.
"htmlcode">
<"hours"));
print($current_date("minutes");
print($current_date("seconds");
"htmlcode">
<"日期合法!n");
"htmlcode">
<"htmlcode">
<"H");
print("50个小时后为:");
print(date("h:i A l F dS,Y",mktime($currenthour+50)));
print("<br>n");
"htmlcode">
<"start:microtime()<br>n");
for($index=0;$index<1000;$index++)
print("good!");
print("stop:microtime()<br>n");
?>
还有,各林威治标准时间函数
以上所述就是本文的全部内容了,希望大家能够喜欢。
上一篇:php中file_exists函数使用详解
下一篇:PHP数组和explode函数示例总结
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。