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.
Call by call
Section titled “Call by call”| @internationalized/date | GMT | Note |
|---|---|---|
parseDate(s) | isValidDate@northguild/ | parseDate throws on 2024-02-30; isValidDate returns false. Measured in M9b. |
parseDateTime(s) | isValidDateTime@northguild/ | |
parseZonedDateTime(s, disambiguation) | isValidZonedDateTime@northguild/isValidCalendarZonedDateTime@northguild/ | The library rejects a string with a [u-ca=…] annotation. Measured in M10, M10c. |
parseAbsolute(s, z) | convertUtcToZoned@northguild/convertZonedToZoned@northguild/ | The library reads an offset with minutes before UTC one hour off. Measured in M11. |
parseAbsoluteToLocal(s) | convertUtcToZoned@northguild/getSystemTimeZone@northguild/ | |
today(z) | getZonedToday@northguild/ | |
now(z) | getZonedNow@northguild/ | |
d.add({ days: 1 }) | addDate@northguild/addZoned@northguild/ | The Berlin gap result is the same. Measured in M1, M2. |
d.add({ months: 1 }) | addDate@northguild/ | The day is clamped to the month length. Measured in M7. |
d.subtract({ … }) | subtractDate@northguild/subtractZoned@northguild/ | |
zdt.add({ hours: 1 }) | addZoned@northguild/ | |
b.compare(a) | diffDate@northguild/ | The library has no month difference; diffDate(a, b, "months") returns one. |
startOfMonth(d), endOfMonth(d) | startOfDate@northguild/endOfDate@northguild/ | |
startOfWeek(d, locale) | getLocaleStartOfWeek@northguild/ | Both read the first day from the locale. |
a.compare(b) < 0 | isBeforeDate@northguild/ | |
isSameDay(a, b), isSameMonth(a, b) | areDatesEqualBy@northguild/ | |
isEqualDay(a, b) | areDatesEqual@northguild/ | |
minDate(a, b), maxDate(a, b) | minDate@northguild/maxDate@northguild/ | GMT takes an array. |
d.calendar.getDaysInMonth(d) | getDaysInMonth@northguild/ | |
getDayOfWeek(d, locale) | getLocaleDayOfWeek@northguild/parseDayOfWeekFromDate@northguild/ | getLocaleDayOfWeek counts from the locale's first day; parseDayOfWeekFromDate returns the ISO number 1 to 7. |
isWeekend(d, locale) | isWeekend@northguild/ | Both read CLDR week data. |
toTimeZone(zdt, z) | convertZonedToZoned@northguild/ | Measured in M16. |
toZoned(dt, z, disambiguation) | convertPlainDateTimeToZoned@northguild/ | The option takes the same four values. Measured in M4, M4b. |
toCalendar(d, createCalendar("japanese")) | convertDateToCalendar@northguild/ | |
getHoursInDay(d, z) | getHoursInZonedDay@northguild/ | |
parseDuration(s), DateFormatter(locale, o).format(…) | parseDuration@northguild/formatDate@northguild/ |
What changes
Section titled “What changes”- The library has immutable
CalendarDate,CalendarDateTimeandZonedDateTimeclasses. GMT takes and returns strings. - Months run from 1 to 12 in both.
- Its
Disambiguationtype has the same four values as Temporal and as GMT:compatible,earlier,laterandreject. - Invalid input throws. GMT returns
"",null,falseor[]. - 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"); // 14Where @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
RFC 3339 section 4.2 · adobe/react-spectrum#10809 · Matrix row
More calls
Section titled “More calls”| @internationalized/date | GMT | Note |
|---|---|---|
getLocalTimeZone() | getSystemTimeZone@northguild/ | |
d.set({ month: 2 }) | setDate@northguild/ | |
fromDate(date, z) | convertUtcToZoned@northguild/ | Pass date.toISOString(). |
| ISO week | getIsoWeekDate@northguild/ | 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.