PHP gmmktime() 函数

PHP 教程 · 2019-01-24 07:27:22

实例

返回 GMT 日期的 UNIX 时间戳,然后使用它来查找该日期的天:

<?php
// Prints: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a ".date("l", gmmktime(0,0,0,10,3,1975));
?>

定义和用法

gmmktime() 函数返回 GMT 日期的 UNIX 时间戳。

提示:该函数与 mktime() 相同,不同的是传递的参数代表了 GMT 日期。

语法

gmmktime(hour,minute,second,month,day,year,is_dst);

参数 描述
hour 可选。规定小时。
minute 可选。规定分。
second 可选。规定秒。
month 可选。规定月。
day 可选。规定天。
year 可选。规定年。
is_dst 可选。参数总是代表 GMT 日期,所以 is_dst 不影响结果。 注意:该参数在 PHP 5.1.0 中被废弃。取而代之使用的是新的时区处理特性。

技术细节

返回值: 返回一个整数 Unix 时间戳。
PHP 版本: 4+
更新日志: PHP 5.1.0:is_dst 参数被废弃。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Understanding Machine Learning

Understanding Machine Learning

Shai Shalev-Shwartz、Shai Ben-David / Cambridge University Press / 2014 / USD 48.51

Machine learning is one of the fastest growing areas of computer science, with far-reaching applications. The aim of this textbook is to introduce machine learning, and the algorithmic paradigms it of......一起来看看 《Understanding Machine Learning》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具