您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關怎么在PHP中利用gmdate將將一個UNIX 時間格式化為GMT文本,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
語法如下:
string gmdate (string $Format) string gmdate (string $Format, int $Time)
演示代碼
<?php echo "When this page was loaded,\n"; echo 'It was 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 ' is not'); echo " a leap year\n"; echo time ('U'), " seconds had elapsed since January 1, 1970.\n"; ?>
輸出結果如下:
When this page was loaded, It was then Sun, 27 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 2009 is not a leap year 1261919333 seconds had elapsed since January 1, 1970.
以上就是怎么在PHP中利用gmdate將將一個UNIX 時間格式化為GMT文本,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。