| 类 | 说明 |
|---|---|
| CronExpression |
Provides a parser and evaluator for unix-like cron expressions.
|
| DatePeriods.Segment | |
| DatePeriodValue |
Date period config value.
|
| Dates |
Date utility
Java处理GMT/UTC日期时间
UTC本身不包含时区偏移(即偏移量为0,实际上就是UTC+0)
UTC时间格式:2000-01-01T01:23:45.123456789Z,其中Z表示`Zulu Time`,Z等价于`+00:00`
时区:
LocalDateTime:无时区
Date(UTC+0):表示自格林威治时间(GMT)1970年1月1日0点经过指定的毫秒数后的时间点
Instant(UTC+0):同Date
ZonedDateTime:自带完整的时区ID(如Asia/Shanghai),支持夏令时(DST)自动调整
OffsetDateTime:自带偏移量时区(固定的UTC偏移量),不支持夏令时
abstract class ZoneId子类:ZoneRegion、ZoneOffset
ZoneId.of("Etc/GMT-8") --> Etc/GMT-8
ZoneId.of("GMT+8") --> GMT+08:00
ZoneId.of("UTC+8") --> UTC+08:00
ZoneId.of("Asia/Shanghai") --> Asia/Shanghai
ZoneId.systemDefault() --> Asia/Shanghai
TimeZone子类(不支持UTC):ZoneInfo
TimeZone.getTimeZone("Etc/GMT-8") --> Etc/GMT-8
TimeZone.getTimeZone("GMT+8") --> GMT+08:00
TimeZone.getTimeZone("Asia/Shanghai") --> Asia/Shanghai
TimeZone.getTimeZone(ZoneId.of("GMT+8")) --> GMT+08:00
TimeZone.getDefault() --> Asia/Shanghai
|
| JacksonDate |
The jackson Serializer & Deserializer for
Date |
| JavaUtilDateFormat |
Convert to
java.util.Date, none zone offset, Thread safe. |
| LocalDateTimeFormat |
Convert to
java.time.LocalDateTime, none zone offset. |
| 枚举 | 说明 |
|---|---|
| DatePeriods |
1990-04-15 00:00:00这天调整了夏令时,即在4月15号0点的时候将表调快了一小时,导致这一天少了一小时。
|
Copyright © 2025. All rights reserved.