简体   繁体   English

给定PHP中的UTC偏移量,如何找到特定HH:MM时间的UNIX时间戳?

[英]How do I find the UNIX timestamp for a specific HH:MM time given a UTC offset in PHP?

I have a list of UTC offsets as integers in seconds. 我有一个以秒为单位的UTC偏移量列表。 For example -36000 for -10 hours. 例如-36000 -10小时。 How can I find the UNIX timestamp for say, 10:00PM at the location with that offset in PHP. 如何在PHP中具有该偏移量的位置找到UNIX时间戳,例如10:00 PM。

PS: It's not homework PS:这不是功课

Thanks 谢谢

new DateTime($yourTimestamp, new DateTimeZone('UTC')); 新的DateTime($ yourTimestamp,新的DateTimeZone('UTC'));

should be fine 应该没事

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM