Use when working with dates, times, timezones, or datetime conversions in TypeScript/JavaScript. Provides guidance on using the tiempo library for timezone-safe datetime handling with the Temporal API.
npx playbooks add skill go-brand/tiempo --skill tiempo
date-fns-style functions for the Temporal API with zero-bundle Intl localization (format, intlFormatDistance, formatDuration). Coming from date-fns? See the [mapping](references/date-fns.md).
pnpm add @gobrand/tiempo
Import from @gobrand/tiempo (includes @js-temporal/polyfill) or @gobrand/tiempo/native on runtimes with built-in Temporal (Node.js 26+, modern browsers) for zero polyfill bundle overhead.
Instant: a moment (timestamps, logs). ZonedDateTime: a moment in a place (UI, scheduling). PlainDate: a calendar date (birthdays, due dates). PlainTime: a clock time (opening hours).startOfDay, addDays, isSameDay) use UTC, and datetime results are UTC ZonedDateTimes. For a user's calendar, convert first: toZonedTime(instant, timezone).(laterDate, earlierDate); intervals take { start, end }.dayOfWeek. Weeks start on Monday unless you pass { weekStartsOn: 7 }; date-fns's 0 for Sunday throws.today(timezone), now(timezone), isToday(date, timezone).toIso(instant)); store date-only values as YYYY-MM-DD.---
| Function | Description | Reference |
|----------|-------------|-----------|
| toInstant() | Turn a string, timestamp, Date, or ZonedDateTime into an Instant. | [details](references/conversion/to-instant.md) |
| toZonedTime() | Show an exact moment in a timezone, as a ZonedDateTime. | [details](references/conversion/to-zoned-time.md) |
| toPlainDate() | Get a calendar date from a string, fields, or a timestamp. | [details](references/conversion/to-plain-date.md) |
| toPlainTime() | Get a clock time from a string, fields, or a timestamp. | [details](references/conversion/to-plain-time.md) |
| toIso() | Turn an Instant or ZonedDateTime into an ISO 8601 string. | [details](references/conversion/to-iso.md) |
| toIso9075() | Turn an Instant or ZonedDateTime into a SQL datetime string. | [details](references/conversion/to-iso9075.md) |
| toDate() | Turn an Instant or ZonedDateTime into a JavaScript Date. | [details](references/conversion/to-date.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| now() | Get the current date and time in a timezone. | [details](references/current-time/now.md) |
| today() | Get today's date in a timezone, as a PlainDate. | [details](references/current-time/today.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| format() | Format a date or time as text using date-fns-style tokens. | [details](references/formatting/format.md) |
| formatPlainDate() | Format a calendar date as text using date-fns-style tokens. | [details](references/formatting/format-plain-date.md) |
| parse() | Read a date or datetime written in a known pattern, using the same tokens as format | [details](references/formatting/parse.md) |
| simpleFormat() | Format a date, a time, or both in a short human-friendly style. | [details](references/formatting/simple-format.md) |
| intlFormatDistance() | Describe the time between two moments, like "in 3 days" or "2 hours ago". | [details](references/formatting/intl-format-distance.md) |
| formatDuration() | Format a Temporal.Duration or duration object as localized human-readable text with Intl.DurationFormat. | [details](references/formatting/format-duration.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| addYears() | Add a number of years to a date or datetime. | [details](references/arithmetic/add-years.md) |
| addQuarters() | Add a number of quarters (3-month periods) to a date or datetime. | [details](references/arithmetic/add-quarters.md) |
| addMonths() | Add a number of months to a date or datetime. | [details](references/arithmetic/add-months.md) |
| addWeeks() | Add a number of weeks to a date or datetime. | [details](references/arithmetic/add-weeks.md) |
| addDays() | Add a number of calendar days to a date or datetime. | [details](references/arithmetic/add-days.md) |
| addHours() | Add a number of hours of elapsed time to a datetime. | [details](references/arithmetic/add-hours.md) |
| addMinutes() | Add a number of minutes to a datetime. | [details](references/arithmetic/add-minutes.md) |
| addSeconds() | Add a number of seconds to a datetime. | [details](references/arithmetic/add-seconds.md) |
| addMilliseconds() | Add a number of milliseconds to a datetime. | [details](references/arithmetic/add-milliseconds.md) |
| addMicroseconds() | Add a number of microseconds to a datetime. | [details](references/arithmetic/add-microseconds.md) |
| addNanoseconds() | Add a number of nanoseconds to a datetime. | [details](references/arithmetic/add-nanoseconds.md) |
| subYears() | Subtract a number of years from a date or datetime. | [details](references/arithmetic/sub-years.md) |
| subQuarters() | Subtract a number of quarters (3-month periods) from a date or datetime. | [details](references/arithmetic/sub-quarters.md) |
| subMonths() | Subtract a number of months from a date or datetime. | [details](references/arithmetic/sub-months.md) |
| subWeeks() | Subtract a number of weeks from a date or datetime. | [details](references/arithmetic/sub-weeks.md) |
| subDays() | Subtract a number of calendar days from a date or datetime. | [details](references/arithmetic/sub-days.md) |
| subHours() | Subtract a number of hours of elapsed time from a datetime. | [details](references/arithmetic/sub-hours.md) |
| subMinutes() | Subtract a number of minutes from a datetime. | [details](references/arithmetic/sub-minutes.md) |
| subSeconds() | Subtract a number of seconds from a datetime. | [details](references/arithmetic/sub-seconds.md) |
| subMilliseconds() | Subtract a number of milliseconds from a datetime. | [details](references/arithmetic/sub-milliseconds.md) |
| subMicroseconds() | Subtract a number of microseconds from a datetime. | [details](references/arithmetic/sub-microseconds.md) |
| subNanoseconds() | Subtract a number of nanoseconds from a datetime. | [details](references/arithmetic/sub-nanoseconds.md) |
| nextDay() | Get the next date that falls on a given day of the week | [details](references/arithmetic/next-day.md) |
| previousDay() | Get the previous date that fell on a given day of the week | [details](references/arithmetic/previous-day.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| startOfDay() | Get the first moment of a day, in a given timezone. | [details](references/boundaries/start-of-day.md) |
| endOfDay() | Get the last nanosecond of a day, in a given timezone. | [details](references/boundaries/end-of-day.md) |
| startOfWeek() | Get the first day of the week of a date or datetime, Monday unless you choose another. | [details](references/boundaries/start-of-week.md) |
| endOfWeek() | Get the last day of the week of a date or datetime, Sunday unless weeks start on another day. | [details](references/boundaries/end-of-week.md) |
| startOfMonth() | Get the first day of the month for a date or datetime. | [details](references/boundaries/start-of-month.md) |
| endOfMonth() | Get the last day of the month for a date or datetime. | [details](references/boundaries/end-of-month.md) |
| startOfQuarter() | Get the first day of the calendar quarter for a date or datetime. | [details](references/boundaries/start-of-quarter.md) |
| endOfQuarter() | Get the last day of the calendar quarter for a date or datetime. | [details](references/boundaries/end-of-quarter.md) |
| startOfYear() | Get 1 January of the year for a date or datetime. | [details](references/boundaries/start-of-year.md) |
| endOfYear() | Get 31 December of the year for a date or datetime. | [details](references/boundaries/end-of-year.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| roundToNearestHour() | Round a datetime to the hour, or to blocks of 2 to 12 hours. | [details](references/rounding/round-to-nearest-hour.md) |
| roundToNearestMinute() | Round a datetime to the minute, or to slots such as 5, 15, or 30 minutes. | [details](references/rounding/round-to-nearest-minute.md) |
| roundToNearestSecond() | Round a datetime to the second, or to intervals such as 10 or 30 seconds. | [details](references/rounding/round-to-nearest-second.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| isBefore() | Check whether one date, time, or timestamp comes before another. | [details](references/comparison/is-before.md) |
| isAfter() | Check whether one date, time, or timestamp comes after another. | [details](references/comparison/is-after.md) |
| isEqual() | Check whether two dates, times, or timestamps are the same. | [details](references/comparison/is-equal.md) |
| isWithinInterval() | Check whether a timestamp, date, or time of day falls between a start and an end. | [details](references/comparison/is-within-interval.md) |
| areIntervalsOverlapping() | Check whether two time ranges or date ranges share any time | [details](references/comparison/are-intervals-overlapping.md) |
| isFuture() | Check whether a timestamp is later than the current moment. | [details](references/comparison/is-future.md) |
| isPast() | Check whether a timestamp is earlier than the current moment. | [details](references/comparison/is-past.md) |
| isToday() | Check whether a value falls on today's date in a timezone. | [details](references/comparison/is-today.md) |
| isTomorrow() | Check whether a value falls on tomorrow's date in a timezone. | [details](references/comparison/is-tomorrow.md) |
| isYesterday() | Check whether a value falls on yesterday's date in a timezone. | [details](references/comparison/is-yesterday.md) |
| isSameDay() | Check whether two timestamps fall on the same calendar day. | [details](references/comparison/is-same-day.md) |
| isSameWeek() | Check whether two timestamps fall in the same week. | [details](references/comparison/is-same-week.md) |
| isSameMonth() | Check whether two timestamps fall in the same calendar month. | [details](references/comparison/is-same-month.md) |
| isSameQuarter() | Check whether two dates or timestamps fall in the same calendar quarter. | [details](references/comparison/is-same-quarter.md) |
| isSameYear() | Check whether two timestamps fall in the same calendar year. | [details](references/comparison/is-same-year.md) |
| isSameHour() | Check whether two timestamps fall in the same clock hour. | [details](references/comparison/is-same-hour.md) |
| isSameMinute() | Check whether two timestamps fall in the same clock minute. | [details](references/comparison/is-same-minute.md) |
| isSameSecond() | Check whether two timestamps fall in the same clock second. | [details](references/comparison/is-same-second.md) |
| isSameMillisecond() | Check whether two timestamps fall in the same millisecond. | [details](references/comparison/is-same-millisecond.md) |
| isSameMicrosecond() | Check whether two timestamps fall in the same microsecond. | [details](references/comparison/is-same-microsecond.md) |
| isSameNanosecond() | Check whether two timestamps have the same wall-clock reading. | [details](references/comparison/is-same-nanosecond.md) |
| isPlainDateBefore() | Check whether one calendar date comes before another. | [details](references/comparison/is-plain-date-before.md) |
| isPlainDateAfter() | Check whether one calendar date comes after another. | [details](references/comparison/is-plain-date-after.md) |
| isPlainDateEqual() | Check whether two calendar dates are the same day. | [details](references/comparison/is-plain-date-equal.md) |
| isPlainTimeBefore() | Check whether one wall-clock time comes before another. | [details](references/comparison/is-plain-time-before.md) |
| isPlainTimeAfter() | Check whether one wall-clock time comes after another. | [details](references/comparison/is-plain-time-after.md) |
| isPlainTimeEqual() | Check whether two wall-clock times are the same. | [details](references/comparison/is-plain-time-equal.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| compareAsc() | Comparator that sorts dates and times oldest first | [details](references/selection/compare-asc.md) |
| compareDesc() | Comparator that sorts dates and times newest first | [details](references/selection/compare-desc.md) |
| min() | Get the earliest date, time, or datetime in an array | [details](references/selection/min.md) |
| max() | Get the latest date, time, or datetime in an array | [details](references/selection/max.md) |
| clamp() | Keep a date, time, or datetime inside a range | [details](references/selection/clamp.md) |
| closestTo() | Find the date, time, or datetime nearest to a target | [details](references/selection/closest-to.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| differenceInYears() | Count the full years between two dates or datetimes | [details](references/difference/difference-in-years.md) |
| differenceInQuarters() | Count the quarters (3-month blocks) between two dates or datetimes | [details](references/difference/difference-in-quarters.md) |
| differenceInMonths() | Count the calendar months between two dates or datetimes | [details](references/difference/difference-in-months.md) |
| differenceInWeeks() | Count the weeks between two dates or datetimes | [details](references/difference/difference-in-weeks.md) |
| differenceInDays() | Count the days between two dates or datetimes | [details](references/difference/difference-in-days.md) |
| differenceInHours() | Count the hours elapsed between two datetimes | [details](references/difference/difference-in-hours.md) |
| differenceInMinutes() | Count the minutes elapsed between two datetimes | [details](references/difference/difference-in-minutes.md) |
| differenceInSeconds() | Count the seconds elapsed between two datetimes | [details](references/difference/difference-in-seconds.md) |
| differenceInMilliseconds() | Count the milliseconds elapsed between two datetimes | [details](references/difference/difference-in-milliseconds.md) |
| differenceInMicroseconds() | Count the microseconds elapsed between two datetimes | [details](references/difference/difference-in-microseconds.md) |
| differenceInNanoseconds() | Get the exact nanoseconds between two datetimes as a bigint | [details](references/difference/difference-in-nanoseconds.md) |
| differenceInCalendarYears() | Count the calendar years between two dates, ignoring month and day | [details](references/difference/difference-in-calendar-years.md) |
| differenceInCalendarQuarters() | Count the calendar quarters between two dates | [details](references/difference/difference-in-calendar-quarters.md) |
| differenceInCalendarMonths() | Count the calendar months between two dates, ignoring the day | [details](references/difference/difference-in-calendar-months.md) |
| differenceInCalendarWeeks() | Count the week boundaries between two dates | [details](references/difference/difference-in-calendar-weeks.md) |
| differenceInCalendarDays() | Count the calendar days between two dates, ignoring the time of day | [details](references/difference/difference-in-calendar-days.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| isWeekend() | Check if a date falls on a Saturday or Sunday | [details](references/business-days/is-weekend.md) |
| addBusinessDays() | Add Monday–Friday days, skipping weekends and holidays | [details](references/business-days/add-business-days.md) |
| subBusinessDays() | Subtract Monday–Friday days, skipping weekends and holidays | [details](references/business-days/sub-business-days.md) |
| differenceInBusinessDays() | Count Monday–Friday days between two dates, leaving out holidays | [details](references/business-days/difference-in-business-days.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| eachYearOfInterval() | List 1 January of each year a range touches | [details](references/intervals/each-year-of-interval.md) |
| eachQuarterOfInterval() | List the first day of each quarter a range touches | [details](references/intervals/each-quarter-of-interval.md) |
| eachMonthOfInterval() | List the first day of each month a range touches | [details](references/intervals/each-month-of-interval.md) |
| eachWeekOfInterval() | List the first day of each week a range touches | [details](references/intervals/each-week-of-interval.md) |
| eachDayOfInterval() | List every day from start to end, including both | [details](references/intervals/each-day-of-interval.md) |
| eachHourOfInterval() | List the start of every hour from start to end | [details](references/intervals/each-hour-of-interval.md) |
| eachMinuteOfInterval() | List the start of every minute from start to end | [details](references/intervals/each-minute-of-interval.md) |
| intervalToDuration() | Break down the span between two dates, times, or moments into a Temporal.Duration. | [details](references/intervals/interval-to-duration.md) |
| Function | Description | Reference |
|----------|-------------|-----------|
| getQuarter() | Get the calendar quarter (1 to 4) of a date or datetime. | [details](references/utilities/get-quarter.md) |
| browserTimezone() | Get the IANA timezone of the device running the code. | [details](references/utilities/browser-timezone.md) |
import type { Timezone, IANATimezone } from '@gobrand/tiempo';
// Timezone: suggested IANA names and UTC; arbitrary strings are also accepted
const tz: Timezone = 'America/New_York'; // Autocomplete for 400+ timezones
// IANATimezone: suggested identifiers plus arbitrary strings (including "UTC")
// These types provide autocomplete, not runtime timezone validation.
const iana: IANATimezone = 'Europe/London';Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.