DESKTOP-7O1P1F7_20200902-齐元朝

Date于LocalDate

桥梁:Instant : 通过Date中实例方法toInstant()方法产生一个Instant实例,其余别的各种类型日期或时间实例都可以通过类方法ofItstant()来创建一个该类型实例

副桥:ZonedDateTime : 通过ZonedDateTime实例方法toInstant();产生一个Instant实例,再通过类方法from(Instant instant)来创建Date实例

Date ==》LocalDate:

Date——》Instant ( +ZoneId )——》LocalDate

​ ——》LocalTime

​ ——》LocalDateTime

​ ——》ZonedDateTimeDateTime

LocalDate ==》 Date:

LocalDate ( +LocalTime )——》LocalDateTime ( +ZoneId )——》ZonedDateTime ——》Instant ——》Date

LocalDate ( +LocalTime +ZoneId )——》ZonedDateTime ——》Instant ——》Date

标签


© 2021 成都云创动力科技有限公司 蜀ICP备20006351号-1