为什么同一时间的Unix时间戳在不同时区不同

编程入门 行业动态 更新时间:2024-10-13 00:35:17
本文介绍了为什么同一时间的Unix时间戳在不同时区不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为什么 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时间戳在不同时区不同

本文发布于:2023-11-24 00:24:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623304.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时区   时间   Unix

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!