为什么同一时间的Unix时间戳在不同时区不同 [英] why Unix Time Stamp for same time is different in different timezone
问题描述
为什么 2013/7/18 11:33
在GMT时区和本地时区(亚洲/加尔各答)不同?
由于Unix时间戳是自纪元 1/1/1970 00:00:00 GMT
开始计算的滴答声,所以我知道纪元时间有发生在不同时区的不同时间间隔,但仍然如此。秒数应该相同
Why 7/18/2013 11:33
is different in GMT timezone and in my local Time Zone (Asia/kolkata)?
As Unix time-stamp are the ticks being calculated since epoch time 1/1/1970 00:00:00 GMT
so i know that there the epoch time had occurred at different interval in different timezone but still. the number of second elapsed should have been same
例如,如果我(+5:30 GMT)和我的朋友(+5:00 GMT)从分别为00:00小时,因此两个时区的18:00时的刻度数应该相同。那么,为什么在Unix时间戳上不是如此呢?
For example if I(+5:30 GMT) and My friend(+5:00 GMT) starts counting the ticks from 00:00 Hrs respectively so at 18:00 Hrs in both timezone number of ticks should be same. So why same thing is not true with the Unix time-stamp.
需要完全理解这个概念。
Need to Understand the concept fully.
推荐答案
例如,如果I(+5:30 GMT)和我的朋友(+5:00 GMT)分别从00:00小时开始计算滴答声,那么在两个时区的18:00时刻度都应该相同。
For example if I(+5:30 GMT) and My friend(+5:00 GMT) starts counting the ticks from 00:00 Hrs respectively so at 18:00 Hrs in both timezone number of ticks should be same.
不,因为你们俩都从00:00开始计数 UTC 。这就是定义。因此,对于您来说,这意味着自18:30开始的滴答声数量,对于您的朋友,这将意味着自19:00开始的滴答声数量。
No, because both of you start counting from 00:00 UTC. That's the definition. So for you, that will mean the number of ticks since 18:30, and for your friend it will mean the number of ticks since 19:00.
单个时刻在任何地方都具有相同的时间戳记值。因此,如果我现在打电话给您(忽略电话延迟),我们都可以同意现在是1374130418的Unix时间戳。您可能对我来说有不同的本地时间,但是我们可以用一种通用格式表示现在。
The idea is that a single instant in time has the same timestamp value everywhere. So if I were calling you now (and ignoring phone delays) we could both agree that "now" is a Unix timestamp of 1374130418. You may have a different local time to me, but we can express "now" in a common format.
请参阅核心概念 部分, Noda Time用户指南,详细讨论了本地时间与全球时间。
See the "core concepts" part of the Noda Time user guide for more discussion of local time vs "global" time.
这篇关于为什么同一时间的Unix时间戳在不同时区不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!