导航首页 » 技术教程 » PHP:gmstrftime()的用法_Date Time函数
PHP:gmstrftime()的用法_Date Time函数 154 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()。


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103