PHP Date Function Date format Unix time method, Dateunix
This example describes the PHP date function, which formats Unix time. Share to everyone for your reference. The specific analysis is as follows:
Date functions can format a UNIX time to the desired text output according to the specified format
Use the following function syntax
String Date (String $Format), string date (string $Format, int $Time);
Here is the demo code
<?phpecho "When this page is loaded,\n"; Echo ' It is then ', date (' R '), "\ n"; Echo ' the currend date was ', Date (' F j , y '), "\ n"; Echo ' the currend date was ', Date (' M J, Y '), "\ n"; Echo ' the currend date was ', date (' m/d/y '), "\ n"; Echo ' T He currend date was the ', date (' JS \o\f M, Y '), "\ n"; Echo ' the currend time was ', date (' G:i:s A T '), "\ n"; Echo ' the CU Rrend time was ', date (' H:i:s O '), "\ n"; Echo date (' Y ');d ate (' L ')? (print ' is '):(print ' was not '), echo "a leap year\n"; Echo Time (' U '), "seconds had elapsed since January 1, 1970.\n";? >
The output is as follows
It is then Sat, 07:09:51 +0000the currend date is December, 2009The currend date was Dec, 2009The Curr End date was 12/26/09the currend date is the 26th of Dec, 2009The currend time is 7:09:51 AM gmtthe currend time was 07: 09:51 +00002009 is not a leap year1261811391 seconds had elapsed since January 1, 1970.
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/970865.html www.bkjia.com true http://www.bkjia.com/PHPjc/970865.html techarticle The php Date function Dates The method of formatting Unix time, Dateunix This example describes the PHP date function, which formats Unix time. Share to everyone for your reference. The specific analysis is as follows: ...