withCalendar method

OffsetDate withCalendar(
  1. CalendarSystem calendar
)

Creates a new OffsetDate representing the same physical date and offset, but in a different calendar. The returned value 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 offset date to.

Returns: The converted OffsetDate.

Implementation

OffsetDate withCalendar(CalendarSystem calendar) =>
    OffsetDate(calendarDate.withCalendar(calendar), offset);