This article describes the date and time operations in the PHP Getting Started Tutorial, this article summarizes and analyzes php's date and time verification, formatting, acquisition, conversion, computation, and other related operation skills based on the instance form, for more information about PHP date and time operations, see the following example. We will share this with you for your reference. The details are as follows:
Demo1.php
Demo2.php
Demo3.php
Demo4.php
Demo5.php
26 [minutes] => 34 [hours] => 10 [mday] => 20 [wday] => 1 [mon] => 4 // [year] => 2015 [yday] => 109 [weekday] => Monday [month] => 1_l [0] => 1429526066) $ t = getdate (); echo $ t ['Year']; // pass a timestamp print_r (getdate (1029526066);?>
Demo6.php
Demo7.php
Demo8.php
Demo9.php
= 60) {echo 'Ask this gentleman to have a rest. ';} Else {echo $ a;}?>
Demo10.php
Demo11.php
'; // I started to set the time zone putenv ('tz = Asia/Shanghai'); echo date ('Y-m-d H: I: s');?>
Demo12.php
'; // Start to configure the default time zone date_default_timezone_set ('Asia/Shanghai'); echo date ('Y-m-d H: I: s'); echo'
'; Echo date_default_timezone_get () ;?>
Demo13.php
37 [tm_min] => 15 [tm_hour] => 19 // [tm_mday] => 20 [tm_mon] => 3 [tm_year] => 115 // [tm_wday] => 1 [tm_yday] => 109 [tm_isdst] => 0)?>
Demo14.php
I hope this article will help you with PHP programming.
For more articles on date and time operations (formatting, verification, retrieval, conversion, computation, and so on) in the PHP Getting Started Tutorial, please follow the PHP Chinese website!