最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

PHP日期函數(shù)date格式化UNIX時(shí)間的方法

 更新時(shí)間:2015年03月19日 10:42:19   作者:work24  
這篇文章主要介紹了PHP日期函數(shù)date格式化UNIX時(shí)間的方法,實(shí)例分析了php中date函數(shù)的使用技巧,需要的朋友可以參考下

本文實(shí)例講述了PHP日期函數(shù)date格式化UNIX時(shí)間的方法。分享給大家供大家參考。具體分析如下:

日期函數(shù)可以根據(jù)指定的格式將一個(gè)unix時(shí)間格式化成想要的文本輸出

使用到函數(shù)語(yǔ)法如下

string date (string $Format);
string date (string $Format, int $Time);

下面是演示代碼

<?php
echo "When this page was loaded,\n";
echo 'It was 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 'The 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 currend time was ', date ('H:i:s O'), "\n";
echo date ('Y');
date ('L')?(print ' is'):(print ' is not');
echo " a leap year\n";
echo time ('U'), " seconds had elapsed since January 1, 1970.\n";
?>

輸出結(jié)果如下

It was then Sat, 26 Dec 2009 07:09:51 +0000
The currend date was December 26, 2009
The currend date was Dec 26, 2009
The currend date was 12/26/09
The currend date was the 26th of Dec, 2009
The currend time was 7:09:51 AM GMT
The currend time was 07:09:51 +0000
2009 is not a leap year
1261811391 seconds had elapsed since January 1, 1970.

希望本文所述對(duì)大家的php程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

西安市| 赫章县| 西和县| 河北省| 陆河县| 金寨县| 曲阜市| 民勤县| 安国市| 民丰县| 图片| 静乐县| 丰宁| 大港区| 松潘县| 鲁山县| 泸溪县| 寿阳县| 长治市| 孝昌县| 内乡县| 西贡区| 留坝县| 宜良县| 平南县| 福安市| 武定县| 盘山县| 河南省| 岱山县| 来凤县| 澄城县| 高密市| 兴文县| 镇坪县| 通州区| 九寨沟县| 勃利县| 札达县| 莱西市| 胶州市|