equal
deleted
inserted
replaced
83 new Date(ZonedDateTime.ofInstant(t.instant, zone)) |
83 new Date(ZonedDateTime.ofInstant(t.instant, zone)) |
84 } |
84 } |
85 |
85 |
86 sealed case class Date(rep: ZonedDateTime) |
86 sealed case class Date(rep: ZonedDateTime) |
87 { |
87 { |
|
88 def to(zone: ZoneId): Date = new Date(rep.withZoneSameInstant(zone)) |
|
89 def to_utc: Date = to(ZoneId.of("UTC")) |
|
90 |
88 def time: Time = Time.instant(Instant.from(rep)) |
91 def time: Time = Time.instant(Instant.from(rep)) |
89 def timezone: ZoneId = rep.getZone |
92 def timezone: ZoneId = rep.getZone |
90 |
93 |
91 def format(fmt: Date.Format = Date.Format.default): String = fmt(this) |
94 def format(fmt: Date.Format = Date.Format.default): String = fmt(this) |
92 override def toString: String = format() |
95 override def toString: String = format() |