如何在PHP中自动检测夏令时? [英] How can I detect day light savings automatically in PHP?

查看:460
本文介绍了如何在PHP中自动检测夏令时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在PHP中自动检测日光节约时间?

How can I detect day light savings automatically in PHP?

推荐答案

echo date('I');

I(大写i)是1/0,表示夏时制是否有效.

The I (capital i) is a 1/0 denoting whether or not daylight saving is currently in effect.

http://php.net/manual/en/function.date.php

希望有帮助.

这篇关于如何在PHP中自动检测夏令时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆