The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
Time seems to be a simple subject; even an inexpensive watch can provide a reasonably accurate date and time.时间似乎是一个简单的主题;即使是便宜的手表也能提供相当准确的日期和时间。However, with closer examination, you realize the subtle complexities and many factors that affect your understanding of time.然而,仔细观察,你会发现微妙的复杂性和许多影响你对时间理解的因素。For example, the result of adding one month to January 31 is different for a leap year than for other years.例如,将1月31日增加一个月,闰年的结果与其他年份不同。Time zones also add complexity.时区也增加了复杂性。For example, a country may go in and out of daylight saving time at short notice, or more than once a year or it may skip daylight saving time entirely for a given year.例如,一个国家可能会在短时间内进入或退出夏令时,或者一年不止一次,或者可能会在给定的一年内完全跳过夏令时。
The Date-Time API uses the calendar system defined in ISO-8601 as the default calendar. 日期时间API使用ISO-8601中定义的日历系统作为默认日历。This calendar is based on the Gregorian calendar system and is used globally as the de facto standard for representing date and time. 本日历以公历为基础,在全球范围内用作表示日期和时间的事实标准。The core classes in the Date-Time API have names such as LocalDateTime, ZonedDateTime, and OffsetDateTime. 日期时间API中的核心类的名称有LocalDateTime、ZonedDateTime和OffsetDateTime。All of these use the ISO calendar system. 所有这些都使用ISO日历系统。If you want to use an alternative calendar system, such as Hijrah or Thai Buddhist, the java.time.chrono package allows you to use one of the predefined calendar systems. 如果您想使用其他日历系统,如Hijrah或Thai Fontal,java.time.chrono包允许您使用预定义的日历系统之一。Or you can create your own.或者你可以创建自己的。
The Date-Time API uses the Unicode Common Locale Data Repository (CLDR). 日期时间API使用Unicode公共语言环境数据存储库(CLDR)。This repository supports the world's languages and contains the world's largest collection of locale data available. 此存储库支持世界上的语言,并包含世界上最大的可用区域设置数据集合。The information in this repository has been localized to hundreds of languages. 此存储库中的信息已本地化为数百种语言。The Date-Time API also uses the Time-Zone Database (TZDB). 日期时间API还使用时区数据库(TZDB)。This database provides information about every time zone change globally since 1970, with history for primary time zones since the concept was introduced.该数据库提供自1970年以来全球所有时区变化的信息,以及自引入该概念以来主要时区的历史记录。