How php converts numeric values to date format
This article introduces in detail the corresponding analysis and solution to the problem of how to convert values into date format by php, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Php converts the value to date format: 1, create a PHP sample file; 2, through "date (" Y-m-d H:i:s ", $dotime);" method to convert digital time into time format.
This article operating environment: Windows7 system, PHP7.1, Dell G3 computer.
How does php convert values to date format?
Php numerical conversion time and time conversion value
The code example is as follows:
Echo $startime=strtotime (date ("Y-m-d", time (); / / 0 o'clock timestamp of the day echo ""; echo $endttime=strtotime (date ("Y-m-d", time ()). '23Y-m-d 59Y-m-d 59'); / / INT type timestamp echo "" at 23:59:59 of the day; / / convert numeric to time character $dotime= "1357985479"; echo date ("Y-m-d H:i:s", $dotime) / / convert numeric time to timeframe echo "; / output current time string echo strtotime (date ('Y-m-d Hlav)); echo"; / / convert numeric to string echo date (' Y-m-d Hlav)); echo"; / / convert string to numeric echo strtotime ('Y-m-d Hrigi') / / echo ""; / / echo strtotime ("- 7 days") in the last seven days
The running results are as follows:
149506560014951519992013-01-12 10 purl 11purl 1914950734702013-01-12 10Vera 11purl 191494468670
This is the answer to the question about how php converts the numerical value into date format. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.