导航首页 »  技术教程 »  PHP:gmstrftime()的用法_Date Time函数
PHP:gmstrftime()的用法_Date Time函数 1042 2023-12-15   

gmstrftime

(PHP 4, PHP 5)

gmstrftime — 根据区域设置格式化 GMT/UTC 时间/日期

说明

string gmstrftime ( string $format [, int $timestamp ] )

和 strftime() 的行为相同,只除了返回时间是格林威治标准时(GMT)。例如,当在东部标准时(EST,GMT -500)运行时,下面第一行显示“Dec 31 1998 20:00:00”,而第二行显示“Jan 01 1999 01:00:00”。

Example #1 gmstrftime() 例子

<?php
setlocale(LC_TIME, 'en_US');
echo strftime("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."n";
echo gmstrftime("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."n";
?>

参见 strftime()。



文章评论 (0条)
发表评论
暂无评论,快来抢沙发吧~