PHP uses Gmdate to implement the method of formatting a Unix time into GMT text
This article mainly introduces PHP using gmdate implementation of a UNIX time format into GMT text method, the example analysis of PHP gmdate function and the use of skills, with a certain reference value, the need for friends can refer to the next
This example describes how PHP uses gmdate to format a UNIX time into GMT text. Share to everyone for your reference. The specific analysis is as follows:
The syntax is as follows:
?
1 2 |
String Gmdate (String $Format) String Gmdate (string $Format, int $Time) |
Demo Code
?
1 2 3 4 5 6 7 8 9 Ten One + |
!--? php echo "When this page is loaded,\n"; Echo ' It is then ', Gmdate (' R '), ' \ n '; Echo ' The Currend gmdate was ', Gmdate (' F J, Y '), "\ n"; Echo ' The Currend gmdate was ', Gmdate (' M J, Y '), "\ n"; Echo ' The Currend gmdate was ', gmdate (' m/d/y '), "\ n"; Echo ' The Currend gmdate was the ', Gmdate (' JS \o\f M, Y '), ' \ n '; Echo ' The currend time was ', Gmdate (' g:i:s A T '), "\ n"; Echo ' The currend time was ', Gmdate (' h:i:s O '), "\ n"; Echo gmdate (' Y '); Gmdate (' L ')? (print ' is '):(print ' isn't '); Echo "a leap year\n"; Echo Time (' U '), "seconds had elapsed since January 1, 1970.\n"; ? |
The output results are as follows:
?
1 2 3 4 5 6 7 8 9 10 |
When the This page is loaded, It was and then Sun, Dec 2009 13:08:53 +0000 The Currend Gmdate was December 27, 2009 The Currend Gmdate was Dec 27, 2009 The Currend gmdate was 12/27/09 The Currend Gmdate was the 27th of Dec, 2009 The currend time was 1:08:53 PM GMT The currend time was 13:08:53 +0000 A leap year 1261919333 seconds had elapsed since January 1, 1970. |
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/970745.html www.bkjia.com true http://www.bkjia.com/PHPjc/970745.html techarticle PHP uses Gmdate to implement the method of formatting a Unix time into GMT text this article mainly introduces PHP using the gmdate implementation of a UNIX time format into GMT text method, example analysis ...