java.time.instant注释翻译

An instantaneous point on the time-line.
时间线上的瞬时点。

This class models a single instantaneous point on the time-line. This might be used to record event time-stamps in the application.

这个类在时间线上模拟一个瞬时点。 这可能用于在应用程序中记录事件时间戳。

The range of an instant requires the storage of a number larger than a {@code long}. To achieve this, the class stores a {@code long} representing epoch-seconds and an {@code int} representing nanosecond-of-second, which will always be between 0 and 999,999,999. The epoch-seconds are measured from the standard Java epoch of {@code 1970-01-01T00:00:00Z} where instants after the epoch have positive values, and earlier instants have negative values. For both the epoch-second and nanosecond parts, a larger value is always later on the time-line than a smaller value.

即时的范围要求存储一个大于 {@code long}的数字。
为此,类存储表示历元秒的 {@code long},表示纳秒的 {@code long},始终介于0和999999999之间。
历元秒是从 {@code 1970-01-01T00:00:00Z} 的标准Java历元测量的,其中历元之后的时刻具有正值,并且较早的时刻具有负值。
对于历元秒和纳秒部分,较大的值总是比较小的值在时间线上晚。

Time-scale 时间尺度

The length of the solar day is the standard way that humans measure time. This has traditionally been subdivided into 24 hours of 60 minutes of 60 second, forming a 86400 second day.

太阳日的长度是人类测量时间的标准方法。
传统上这被细分为24小时60分钟60秒,形成86400秒的一天。

Modern timekeeping is based on atomic clocks which precisely define an SI second relative to the transitions of a Caesium atom. The length of an SI second was defined to be very close to the 86400th fraction of a day.

现代计时是以原子钟为基础的,原子钟精确地定义了相对于铯原子跃迁的硅秒。一个SI秒的长度被定义为非常接近一天的86400分之一。

Unfortunately, as the Earth rotates the length of the day varies. In addition, over time the average length of the day is getting longer as the Earth slows. As a result, the length of a solar day in 2012 is slightly longer than 86400 SI seconds. The actual length of any given day and the amount by which the Earth is slowing are not predictable and can only be determined by measurement. The UT1 time-scale captures the accurate length of day, but is only available some time after the day has completed.

不幸的是,随着地球自转,一天的长度也在变化。
此外,随着时间的推移,随着地球的减速,一天的平均长度也越来越长。
因此,2012年太阳日的长度略长于86400 si秒。
任何一天的实际长度和地球减速的量是不可预测的,只能通过测量来确定。
UT1时间刻度捕捉准确的一天时间长度,但仅在一天完成后的某个时间可用。

The UTC time-scale is a standard approach to bundle up all the additional fractions of a second from UT1 into whole seconds, known as leap-seconds. A leap-second may be added or removed depending on the Earth's rotational changes. As such, UTC permits a day to have 86399 SI seconds or 86401 SI seconds where necessary in order to keep the day aligned with the Sun.

UTC时间刻度是一种标准方法,将一秒钟的所有额外分数从UT1打包为整秒,称为“闰秒”。
根据地球的旋转变化,可以增加或减少闰秒。
因此,UTC允许一天有86399 si秒或86401 si秒(必要时),以使一天与太阳保持一致。

The modern UTC time-scale was introduced in 1972, introducing the concept of whole leap-seconds. Between 1958 and 1972, the definition of UTC was complex, with minor sub-second leaps and alterations to the length of the notional second. As of 2012, discussions are underway to change the definition of UTC again, with the potential to remove leap seconds or introduce other changes.

现代的UTC时间尺度是在1972年引入的,它引入了整个闰秒的概念。
1958年至1972年期间,UTC的定义很复杂,稍有亚秒跳跃,概念秒的长度也发生了变化。截至2012年,正在讨论再次更改UTC的定义,有可能删除闰秒或引入其他更改。

Given the complexity of accurate timekeeping described above, this Java API defines its own time-scale, the Java Time-Scale.

鉴于上面描述的精确计时的复杂性,这个Java API定义了它自己的时间刻度,即 Java时间刻度

The Java Time-Scale divides each calendar day into exactly 86400 subdivisions, known as seconds. These seconds may differ from the SI second. It closely matches the de facto international civil time scale, the definition of which changes from time to time.

Java时间尺度将每个日历日划分为86400个细分,称为秒。这些秒可能与Si秒不同。它与事实上的国际民事时间尺度非常吻合,而国际民事时间尺度的定义则不时地发生变化。

The Java Time-Scale has slightly different definitions for different segments of the time-line, each based on the consensus international time scale that is used as the basis for civil time. Whenever the internationally-agreed time scale is modified or replaced, a new segment of the Java Time-Scale must be defined for it. Each segment must meet these requirements:

Java时间尺度对于时间线的不同段有稍微不同的定义,每一个时间段都基于基于国际时间尺度的一致性国际时间尺度,该时间尺度被用作民用时间的基础。每当国际商定的时间尺度被修改或替换时,就必须定义一个新的Java时间尺度段。每个分段必须满足这些要求:

  • the Java Time-Scale shall closely match the underlying international civil time scale;
  • the Java Time-Scale shall exactly match the international civil time scale at noon each day;
  • the Java Time-Scale shall have a precisely-defined relationship to the international civil time scale.
  • 时间尺度应与国际民事时间尺度密切匹配;
  • 时间尺度应与中午的国际民用时间尺度完全匹配;
  • 时间尺度与国际民事时间尺度有明确的关系。
  • There are currently, as of 2013, two segments in the Java time-scale.

    目前,在2013中,Java时间尺度中有两个段。

    For the segment from 1972-11-03 (exact boundary discussed below) until further notice, the consensus international time scale is UTC (with leap seconds). In this segment, the Java Time-Scale is identical to UTC-SLS. This is identical to UTC on days that do not have a leap second. On days that do have a leap second, the leap second is spread equally over the last 1000 seconds of the day, maintaining the appearance of exactly 86400 seconds per day.

    对于1972-11-03段(下文讨论的确切边界),直到进一步通知,一致的国际时间尺度是UTC(闰秒)。在该段中,Java时间尺度与UTC-SLS 相同。
    在没有闰秒的日子里,这与UTC是相同的。在有闰秒的日子里,闰秒平均分布在一天的最后1000秒,保持每天86400秒的外观。

    For the segment prior to 1972-11-03, extending back arbitrarily far, the consensus international time scale is defined to be UT1, applied proleptically, which is equivalent to the (mean) solar time on the prime meridian (Greenwich). In this segment, the Java Time-Scale is identical to the consensus international time scale. The exact boundary between the two segments is the instant where UT1 = UTC between 1972-11-03T00:00 and 1972-11-04T12:00.

    对于1972-11-03之前任意向后延伸的段,一致国际时间尺度定义为UT1,无理应用,相当于本初子午线(格林威治)上的(平均)太阳时间。在这一段中,Java时间尺度与一致的国际时间尺度相同。两段之间的确切边界是1972-11-03t00:00和1972-11-04t12:00之间的ut1=utc。

    Implementations of the Java time-scale using the JSR-310 API are not required to provide any clock that is sub-second accurate, or that progresses monotonically or smoothly. Implementations are therefore not required to actually perform the UTC-SLS slew or to otherwise be aware of leap seconds. JSR-310 does, however, require that implementations must document the approach they use when defining a clock representing the current instant. See {@link Clock} for details on the available clocks.

    使用JSR310API的Java时间尺度的实现不需要提供任何秒精度的时钟,或者单调地或平滑地进行的时钟。因此,不需要实际执行UTC-SLS转换,也不需要了解闰秒。然而,JSR-310确实要求实现必须记录在定义表示当前时刻的时钟时使用的方法。
    有关可用时钟的详细信息,请参见@link clock。

    The Java time-scale is used for all date-time classes. This includes {@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime}, {@code ZonedDateTime} and {@code Duration}.

    Java时间刻度用于所有的日期时间类。
    这包括{@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime}, {@code ZonedDateTime} 和 {@code Duration}。

    This is a value-based class; use of identity-sensitive operations (including reference equality ({@code ==}), identity hash code, or synchronization) on instances of {@code Instant} may have unpredictable results and should be avoided. The {@code equals} method should be used for comparisons. @implSpec This class is immutable and thread-safe.

    这是一个基于值的类;在{@code Instant}的实例上使用身份敏感操作(包括引用相等({@code ==})、标识哈希代码或同步)可能会有不可预知的结果,并且应该避免。
    应使用{@code equals} 方法进行比较。
    @implSpec
    这个类是不可变的,并且是线程安全的。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值