UNIX 时间戳会跨时区变化吗? [英] Do UNIX timestamps change across timezones?

查看:51
本文介绍了UNIX 时间戳会跨时区变化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如主题所问;每个时区的 UNIX 时间戳会发生变化吗?

例如,如果我向世界另一端的另一封电子邮件发送请求,说在时间为 1397484936 时发送电子邮件",其他服务器的时间戳比我自己的晚 12 小时?

解决方案

UNIX 时间戳的定义与时区无关.UNIX 时间戳是自 UTC 时间 1970 年 1 月 1 日午夜的绝对时间点以来经过的秒数(或毫秒).(UTC 是格林威治标准时间,没有夏令时调整.)无论您所在的时区如何,UNIX 时间戳都代表一个在任何地方都相同的时刻.当然,如果需要,您可以来回转换本地时区表示(时间 1397484936 是纽约的某某本地时间,或雅加达的其他本地时间).>

http://en.wikipedia.org/wiki/Unix_time 上的文章很漂亮如果您想阅读更长的时间,这会令人印象深刻.

As the subject asks; do UNIX timestamps change in each timezone?

For example, if I sent a request to another email the other side of the world saying, "Send out an email when the time is 1397484936", would the other server's timestamp be 12 hours behind my own?

解决方案

The definition of UNIX timestamp is time zone independent. The UNIX timestamp is the number of seconds (or milliseconds) elapsed since an absolute point in time, midnight of Jan 1 1970 in UTC time. (UTC is Greenwich Mean Time without Daylight Savings time adjustments.) Regardless of your time zone, the UNIX timestamp represents a moment that is the same everywhere. Of course you can convert back and forth to a local time zone representation (time 1397484936 is such-and-such local time in New York, or some other local time in Djakarta) if you want.

The article at http://en.wikipedia.org/wiki/Unix_time is pretty impressive if you'd like a longer read.

这篇关于UNIX 时间戳会跨时区变化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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