Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我读过 php 的 datetime 类在生成新的日期时间对象时依赖于服务器时钟。假设服务器位于遵守夏令时的位置,并且它的时区配置正确。我们是否可以信任在这一小时转换期间创建的日期时间对象,或者我们是否应该始终将服务器时间配置为 UTC?
是的,你可以相信它。它使用来自操作系统的时区信息。