(1)查看日期函数拓展
phpinfo()
打开上述页面之后,可以看到以下,证明已经安装日期拓展
浏览器输入php.net访问php的文档
(2)设置时区
方式一:修改配置文件php.ini
D:\ITSoft\wamp64\bin\php\php7.0.10\php.ini
[Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone = PRC ; http://php.net/date.default-latitude ;date.default_latitude = 31.7667 ; http://php.net/date.default-longitude ;date.default_longitude = 35.2333 ; http://php.net/date.sunrise-zenith ;date.sunrise_zenith = 90.583333 ; http://php.net/date.sunset-zenith ;date.sunset_zenith = 90.583333方式二:date_default_timezone_set
方式三:init_set
设置指定配置选项的值。这个选项会在脚本运行时保持新的值,并在脚本结束时恢复
(3)常用时间函数
常用参数
date使用
time mktime的使用
strtotime使用
microtime()
其他函数
53 // [minutes] => 40 // [hours] => 8 // [mday] => 20 // [wday] => 3 // [mon] => 12 // [year] => 2017 // [yday] => 353 // [weekday] => Wednesday // [month] => // December [0] => 1513759253 //)(4)时间控件的使用test.php
H5新增表单控件 H5新增表单日期时间控件
doAction.php