国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

PHP使用gmdate實現將一個UNIX 時間格式化成GMT文本的方法

2024-05-04 23:32:54
字體:
來源:轉載
供稿:網友

這篇文章主要介紹了PHP使用gmdate實現將一個UNIX 時間格式化成GMT文本的方法,實例分析了php中gmdate函數的功能及使用技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了PHP使用gmdate實現將一個UNIX 時間格式化成GMT文本的方法。分享給大家供大家參考。具體分析如下:

語法如下:

 

 
  1. string gmdate (string $Format
  2. string gmdate (string $Format, int $Time

演示代碼

 

 
  1. <?php 
  2. echo "When this page was loaded,/n"
  3. echo 'It was then 'gmdate ('r'), "/n"
  4. echo 'The currend gmdate was 'gmdate ('F j, Y'), "/n"
  5. echo 'The currend gmdate was 'gmdate ('M j, Y'), "/n"
  6. echo 'The currend gmdate was 'gmdate ('m/d/y'), "/n"
  7. echo 'The currend gmdate was the 'gmdate ('jS /o/f M, Y'), "/n"
  8. echo 'The currend time was 'gmdate ('g:i:s A T'), "/n"
  9. echo 'The currend time was 'gmdate ('H:i:s O'), "/n"
  10. echo gmdate ('Y'); 
  11. gmdate ('L')?(print ' is'):(print ' is not'); 
  12. echo " a leap year/n"
  13. echo time ('U'), " seconds had elapsed since January 1, 1970./n"
  14. ?> 

輸出結果如下:

 

 
  1. When this page was loaded, 
  2. It was then Sun, 27 Dec 2009 13:08:53 +0000 
  3. The currend gmdate was December 27, 2009 
  4. The currend gmdate was Dec 27, 2009 
  5. The currend gmdate was 12/27/09 
  6. The currend gmdate was the 27th of Dec, 2009 
  7. The currend time was 1:08:53 PM GMT 
  8. The currend time was 13:08:53 +0000 
  9. 2009 is not a leap year 
  10. 1261919333 seconds had elapsed since January 1, 1970. 

希望本文所述對大家的php程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 东乌| 县级市| 广西| 女性| 汽车| 南宫市| 通许县| 连城县| 阳朔县| 阿瓦提县| 兴化市| 宣武区| 沾益县| 香格里拉县| 上林县| 吉林市| 木里| 乾安县| 泰州市| 个旧市| 田阳县| 莱芜市| 昭觉县| 蕲春县| 泰兴市| 察哈| 松潘县| 都昌县| 藁城市| 盐边县| 三河市| 鲁甸县| 永胜县| 晋江市| 苍梧县| 昂仁县| 凌海市| 长汀县| 长葛市| 威海市| 宁国市|