国产探花免费观看_亚洲丰满少妇自慰呻吟_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程序設計有所幫助。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 深泽县| 公主岭市| 大姚县| 昌图县| 青州市| 闽侯县| 搜索| 宜黄县| 武城县| 新宁县| 昆明市| 永平县| 涟源市| 广丰县| 汉川市| 普格县| 西华县| 绍兴县| 兴文县| 青浦区| 云阳县| 承德县| 理塘县| 巴马| 石台县| 长寿区| 个旧市| 巨野县| 惠安县| 广东省| 青州市| 霍林郭勒市| 香格里拉县| 呈贡县| 依安县| 剑川县| 水城县| 大邑县| 弥勒县| 益阳市| 昌邑市|