PHP strftime() 函数
PHP 教程
· 2019-01-24 08:57:23
实例
根据区域设置格式化本地日期和时间:
echo(strftime("%B %d %Y, %X %Z",mktime(20,0,0,12,31,98))."<br>");
setlocale(LC_ALL,"hu_HU.UTF8");
echo(strftime("%Y. %B %d. %A. %X %Z"));
定义和用法
strftime() 函数根据区域设置格式化本地日期和时间。
提示:请查阅 gmstrftime() 函数,根据区域设置格式化 GMT/UTC 时间/日期。
语法
strftime(format,timestamp);
| 参数 | 描述 |
|---|---|
| format | 必需。规定如何返回结果:
|
| timestamp | 可选。规定需要格式化的日期/时间的 Unix 时间戳。默认为当前时间(time())。 |
技术细节
| 返回值: | 返回根据 format 使用给定的 timestamp 格式化的字符串。月份和星期几的名称和其他语言相关的字符串遵守 setlocale() 中的当前区域设置。 |
|---|---|
| PHP 版本: | 4+ |
| 更新日志: | PHP 5.1.0:增加 E_STRICT 和 E_NOTICE 时区错误。 |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Beginning XML with DOM and Ajax
Sas Jacobs / Apress / 2006-06-05 / USD 39.99
Don't waste time on 1,000-page tomes full of syntax; this book is all you need to get ahead in XML development. Renowned web developer Sas Jacobs presents an essential guide to XML. Beginning XML with......一起来看看 《Beginning XML with DOM and Ajax》 这本书的介绍吧!