PHP idate() 函数
PHP 教程
· 2019-01-24 07:59:30
实例
格式化本地时间/日期为整数。测试所有不同的格式:
<?php
echo idate("B") . "<br>";
echo idate("d") . "<br>";
echo idate("h") . "<br>";
echo idate("H") . "<br>";
echo idate("i") . "<br>";
echo idate("I") . "<br>";
echo idate("L") . "<br>";
echo idate("m") . "<br>";
echo idate("s") . "<br>";
echo idate("t") . "<br>";
echo idate("U") . "<br>";
echo idate("w") . "<br>";
echo idate("W") . "<br>";
echo idate("y") . "<br>";
echo idate("Y") . "<br>";
echo idate("z") . "<br>";
echo idate("Z") . "<br>";
?>
echo idate("B") . "<br>";
echo idate("d") . "<br>";
echo idate("h") . "<br>";
echo idate("H") . "<br>";
echo idate("i") . "<br>";
echo idate("I") . "<br>";
echo idate("L") . "<br>";
echo idate("m") . "<br>";
echo idate("s") . "<br>";
echo idate("t") . "<br>";
echo idate("U") . "<br>";
echo idate("w") . "<br>";
echo idate("W") . "<br>";
echo idate("y") . "<br>";
echo idate("Y") . "<br>";
echo idate("z") . "<br>";
echo idate("Z") . "<br>";
?>
定义和用法
idate() 函数格式化本地时间/日期为整数。
注意:idate() 函数只接受一个字符作为 format 参数!
语法
idate(format,timestamp);
| 参数 | 描述 |
|---|---|
| format | 必需。规定如何返回结果:
|
| timestamp | 可选。规定需要格式化的日期/时间的 Unix 时间戳。默认为当前时间(time())。 |
技术细节
| 返回值: | 返回根据指定的 format 使用给定的 timestamp 格式化的整数。 |
|---|---|
| PHP 版本: | 5+ |
| 更新日志: | PHP 5.1.0:增加 E_STRICT 和 E_NOTICE 时区错误。 |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Designing for Emotion
Aarron Walter / Happy Cog / 2011-10-18 / USD 18.00
Make your users fall in love with your site via the precepts packed into this brief, charming book by MailChimp user experience design lead Aarron Walter. From classic psychology to case studies, high......一起来看看 《Designing for Emotion》 这本书的介绍吧!