PHP函数strftime介绍
定义和用法
strftime() 函数根据区域设置格式化本地时间/日期。
语法
strftime(format,timestamp)
提示和注释
提示:与 gmstrftime() 的行为相同,不同的是返回时间是本地时间。
例子
输出 strftime() 和 gmstrftime() 的结果:
<?phpecho(strftime("%b %d %Y %X", mktime(20,0,0,12,31,98)));echo(gmstrftime("%b %d %Y %X", mktime(20,0,0,12,31,98)));//输出当前日期、时间和时区echo(gmstrftime("It is %a on %b %d, %Y, %X time zone: %Z",time()));?>
输出:
Dec 31 1998 20:00:00Dec 31 1998 19:00:00It is Wed on Jan 25, 2006, 11:32:10 time zone: W. Europe Standard Time
本文出自:琅枫个人博客。如需转载请注明出处!
本文出处:"https://www.phpfeng.cn/function/216.html"
如果您觉得文章对你有帮助,可以进行打赏。
打赏多少,您高兴就行,谢谢您对琅枫博客的支持! ~(@^_^@)~
微信打赏

支付宝打赏
