Skip to content

Migrate from @internationalized/date to Temporal with GMT

Checked against @internationalized/date 3.12.4 on 2026-10-27.

Migrate to Temporal with GMT explains the one change that applies to every call below: GMT takes strings in and gives strings out.

@internationalized/dateGMTNote
parseDate(s)
isValidDate@northguild/gmt/plain/validate
parseDate throws on 2024-02-30; isValidDate returns false. Measured in M9b.
parseDateTime(s)
isValidDateTime@northguild/gmt/plain/validate
parseZonedDateTime(s, disambiguation)
isValidZonedDateTime@northguild/gmt/zoned/validate
isValidCalendarZonedDateTime@northguild/gmt/zoned/validate
The library rejects a string with a [u-ca=…] annotation. Measured in M10, M10c.
parseAbsolute(s, z)
convertUtcToZoned@northguild/gmt/utc/convert
convertZonedToZoned@northguild/gmt/zoned/convert
The library reads an offset with minutes before UTC one hour off. Measured in M11.
parseAbsoluteToLocal(s)
convertUtcToZoned@northguild/gmt/utc/convert
getSystemTimeZone@northguild/gmt/zoned/get
today(z)
getZonedToday@northguild/gmt/zoned/get
now(z)
getZonedNow@northguild/gmt/zoned/get
d.add({ days: 1 })
addDate@northguild/gmt/plain/calculate
addZoned@northguild/gmt/zoned/calculate
The Berlin gap result is the same. Measured in M1, M2.
d.add({ months: 1 })
addDate@northguild/gmt/plain/calculate
The day is clamped to the month length. Measured in M7.
d.subtract({ … })
subtractDate@northguild/gmt/plain/calculate
subtractZoned@northguild/gmt/zoned/calculate
zdt.add({ hours: 1 })
addZoned@northguild/gmt/zoned/calculate
b.compare(a)
diffDate@northguild/gmt/plain/calculate
The library has no month difference; diffDate(a, b, "months") returns one.
startOfMonth(d), endOfMonth(d)
startOfDate@northguild/gmt/plain/calculate
endOfDate@northguild/gmt/plain/calculate
startOfWeek(d, locale)
getLocaleStartOfWeek@northguild/gmt/plain/calculate
Both read the first day from the locale.
a.compare(b) < 0
isBeforeDate@northguild/gmt/plain/compare
isSameDay(a, b), isSameMonth(a, b)
areDatesEqualBy@northguild/gmt/plain/compare
isEqualDay(a, b)
areDatesEqual@northguild/gmt/plain/compare
minDate(a, b), maxDate(a, b)
minDate@northguild/gmt/plain/calculate
maxDate@northguild/gmt/plain/calculate
GMT takes an array.
d.calendar.getDaysInMonth(d)
getDaysInMonth@northguild/gmt/plain/calculate
getDayOfWeek(d, locale)
getLocaleDayOfWeek@northguild/gmt/plain/calculate
parseDayOfWeekFromDate@northguild/gmt/plain/parse
getLocaleDayOfWeek counts from the locale's first day; parseDayOfWeekFromDate returns the ISO number 1 to 7.
isWeekend(d, locale)
isWeekend@northguild/gmt/plain/compare
Both read CLDR week data.
toTimeZone(zdt, z)
convertZonedToZoned@northguild/gmt/zoned/convert
Measured in M16.
toZoned(dt, z, disambiguation)
convertPlainDateTimeToZoned@northguild/gmt/zoned/convert
The option takes the same four values. Measured in M4, M4b.
toCalendar(d, createCalendar("japanese"))
convertDateToCalendar@northguild/gmt/plain/convert
getHoursInDay(d, z)
getHoursInZonedDay@northguild/gmt/zoned/calculate
parseDuration(s), DateFormatter(locale, o).format(…)
parseDuration@northguild/gmt/duration/parse
formatDate@northguild/gmt/plain/format
  • The library has immutable CalendarDate, CalendarDateTime and ZonedDateTime classes. GMT takes and returns strings.
  • Months run from 1 to 12 in both.
  • Its Disambiguation type has the same four values as Temporal and as GMT: compatible, earlier, later and reject.
  • Invalid input throws. GMT returns "", null, false or [].
  • The library has no ISO-week call and no month difference between two dates.
import { diffDate } from "@northguild/gmt/plain/calculate";
diffDate("2024-03-01", "2024-03-15", "days"); // 14

Where @internationalized/date differs from Temporal

Section titled “Where @internationalized/date differs from Temporal”

Each item is a case where the library’s result differs from Temporal’s. The full matrix also lists the cases where it matches.

  • M9c Parse a date in basic format

    Input
    "20240212"
    Library returns
    Error: Invalid ISO 8601 date string: 20240212
    Temporal returns
    2024-02-12
  • M10c Read a string with a calendar annotation

    Input
    2024-03-31T03:30:00+02:00[Europe/Berlin][u-ca=japanese]
    Library returns
    RangeError: Invalid time zone specified: Europe/Berlin][u-ca=japanese
    Temporal returns
    accepted
  • M11 Read an offset with minutes before UTC

    Input
    2024-01-15T12:00:00-03:30
    Library returns
    2024-01-15T14:30:00.000Z
    Temporal returns
    2024-01-15T15:30:00Z
@internationalized/dateGMTNote
getLocalTimeZone()
getSystemTimeZone@northguild/gmt/zoned/get
d.set({ month: 2 })
setDate@northguild/gmt/plain/calculate
fromDate(date, z)
convertUtcToZoned@northguild/gmt/utc/convert
Pass date.toISOString().
ISO week
getIsoWeekDate@northguild/gmt/calendar/calculate
The library has no ISO-week call. Measured in M12.

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else:© 2026 NorthGuild, all rights reserved.