withCalendar method

ZonedDateTime withCalendar(
  1. CalendarSystem calendar
)

Creates a new ZonedDateTime representing the same physical date, time and offset, but in a different calendar. The returned ZonedDateTime is likely to have different date field values to this one. For example, January 1st 1970 in the Gregorian calendar was December 19th 1969 in the Julian calendar.

  • calendar: The calendar system to convert this zoned date and time to.

Returns: The converted ZonedDateTime.

Implementation

ZonedDateTime withCalendar(CalendarSystem calendar) {
  return ZonedDateTime._(_offsetDateTime.withCalendar(calendar), zone);
}