The date () function takes the time stamp to make it easier for Huawei to read the dates and times.
Get a simple date
The usual term date character:
* D-denotes the day of the month (01-31)
* M-Denotes month (01-12)
* Y-denotes year (four digits)
* 1-Indicates a day of the week
Other characters, such as "/", "." Or "-" can also be inserted into characters to add additional formatting.
Code:
<?phpecho "Today is". Date ("Y/m/d"). "<br>"; echo "Today is." Date ("Y.M.D"). "<br>"; echo "Today is." Date ("y-m-d"). "<br>"; echo "Today is." Date ("1"). "<br>";//PHP Hint-auto copyright year echo "@ 2010-". Date ("Y"). "<br>";/* Get simple time-commonly used characters for time: * H-12 hour format with First zero * I-sub-station with first zero * s-second with First zero (00-59) * A-lowercase noon and afternoon (AM or PM) */echo "The Time is now" . Date ("H:i:sa"). "<br/>";//Get Time zone Date_default_timezone_set (' Asia/shanghai '); Echo ' Current time is '. Date (' H:i:sa '). "<br/>";//Created by PHP mktime date $d = Mktime (9, 6, +, +-); Echo ' creation date is '. Date (' y-m-d h:i:sa ', $d);? >
Echo:
PHP Date and time