(date: ZonedDateTime, timeZone: string)
| 379 | |
| 380 | /** Converts a `ZonedDateTime` from one time zone to another. */ |
| 381 | export function toTimeZone(date: ZonedDateTime, timeZone: string): ZonedDateTime { |
| 382 | let ms = epochFromDate(date) - date.offset; |
| 383 | return toCalendar(fromAbsolute(ms, timeZone), date.calendar); |
| 384 | } |
| 385 | |
| 386 | /** Converts the given `ZonedDateTime` into the user's local time zone. */ |
| 387 | export function toLocalTimeZone(date: ZonedDateTime): ZonedDateTime { |
no test coverage detected