tiempo

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.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "tiempo" with this command: npx skills add go-brand/tiempo/go-brand-tiempo-tiempo

tiempo - Timezone-Safe Datetime Handling

Lightweight utility library for timezone conversions built on the Temporal API.

npm install @gobrand/tiempo

Best Practices

  • Always use explicit timezones - Never rely on implicit timezone behavior. details
  • Don't use JavaScript Date - Use tiempo instead of Date for timezone work. details
  • Store UTC, display local - Backend stores UTC, frontend converts for display. details

Conversion

FunctionDescriptionReference
toZonedTime()Convert to a timezone-aware ZonedDateTimedetails
toPlainTime()Parse a plain time or extract wall-clock time from a datetimedetails
toPlainDate()Parse a plain date or extract calendar date from a datetimedetails
toUtc()Convert to a UTC Instantdetails
toIso()Convert to an ISO 8601 stringdetails
toIso9075()Convert to ISO 9075 (SQL) format stringdetails
toDate()Convert to a JavaScript Date objectdetails

Current Time

FunctionDescriptionReference
now()Get the current date and time as a ZonedDateTimedetails
today()Get today's date as a PlainDatedetails

Formatting

FunctionDescriptionReference
format()Format a datetime using date-fns-like format tokensdetails
formatPlainDate()Format a PlainDate using date-fns-like format tokensdetails
simpleFormat()Human-friendly date/time formatting with explicit control over what to displaydetails
intlFormatDistance()Format the distance between dates as human-readable, internationalized stringsdetails

Arithmetic

FunctionDescriptionReference
addYears()Add years to a datetimedetails
addMonths()Add months to a datetimedetails
addWeeks()Add weeks to a datetimedetails
addDays()Add days to a datetime (DST-safe)details
addHours()Add hours to a datetimedetails
addMinutes()Add minutes to a datetimedetails
addSeconds()Add seconds to a datetimedetails
addMilliseconds()Add milliseconds to a datetimedetails
addMicroseconds()Add microseconds to a datetimedetails
addNanoseconds()Add nanoseconds to a datetimedetails
subYears()Subtract years from a datetimedetails
subMonths()Subtract months from a datetimedetails
subWeeks()Subtract weeks from a datetimedetails
subDays()Subtract days from a datetimedetails
subHours()Subtract hours from a datetimedetails
subMinutes()Subtract minutes from a datetimedetails
subSeconds()Subtract seconds from a datetimedetails
subMilliseconds()Subtract milliseconds from a datetimedetails
subMicroseconds()Subtract microseconds from a datetimedetails
subNanoseconds()Subtract nanoseconds from a datetimedetails

Boundaries

FunctionDescriptionReference
startOfDay()Get the first moment of the daydetails
endOfDay()Get the last moment of the daydetails
startOfWeek()Get the first moment of the week (Monday)details
endOfWeek()Get the last moment of the week (Sunday)details
startOfMonth()Get the first moment of the monthdetails
endOfMonth()Get the last moment of the monthdetails
startOfYear()Get the first moment of the yeardetails
endOfYear()Get the last moment of the yeardetails

Comparison

FunctionDescriptionReference
isBefore()Check if one datetime is before anotherdetails
isAfter()Check if one datetime is after anotherdetails
isWithinInterval()Check if a datetime falls within an intervaldetails
isFuture()Check if a datetime is in the futuredetails
isPast()Check if a datetime is in the pastdetails
isSameDay()Check if two datetimes are on the same calendar daydetails
isSameWeek()Check if two datetimes are in the same ISO weekdetails
isSameMonth()Check if two datetimes are in the same calendar monthdetails
isSameYear()Check if two datetimes are in the same calendar yeardetails
isSameHour()Check if two datetimes are in the same hourdetails
isSameMinute()Check if two datetimes are in the same minutedetails
isSameSecond()Check if two datetimes are in the same seconddetails
isSameMillisecond()Check if two datetimes are in the same milliseconddetails
isSameMicrosecond()Check if two datetimes are in the same microseconddetails
isSameNanosecond()Check if two datetimes are in the same nanoseconddetails
isPlainDateBefore()Check if a PlainDate is before another PlainDatedetails
isPlainDateAfter()Check if a PlainDate is after another PlainDatedetails
isPlainDateEqual()Check if two PlainDates are equaldetails
isPlainTimeBefore()Check if a PlainTime is before another PlainTimedetails
isPlainTimeAfter()Check if a PlainTime is after another PlainTimedetails
isPlainTimeEqual()Check if two PlainTimes are equaldetails

Difference

FunctionDescriptionReference
differenceInYears()Calculate the difference between two dates in yearsdetails
differenceInMonths()Calculate the difference between two dates in monthsdetails
differenceInWeeks()Calculate the difference between two dates in weeksdetails
differenceInDays()Calculate the difference between two dates in daysdetails
differenceInHours()Calculate the difference between two dates in hoursdetails
differenceInMinutes()Calculate the difference between two dates in minutesdetails
differenceInSeconds()Calculate the difference between two dates in secondsdetails
differenceInMilliseconds()Calculate the difference between two datetimes in millisecondsdetails
differenceInMicroseconds()Calculate the difference between two datetimes in microsecondsdetails
differenceInNanoseconds()Calculate the difference between two datetimes in nanosecondsdetails

Intervals

FunctionDescriptionReference
eachYearOfInterval()Get all years in an interval as ZonedDateTime arraydetails
eachMonthOfInterval()Get all months in an interval as ZonedDateTime arraydetails
eachWeekOfInterval()Get all weeks (ISO Monday start) in an interval as ZonedDateTime arraydetails
eachDayOfInterval()Get all days in an interval as ZonedDateTime arraydetails
eachHourOfInterval()Get all hours in an interval as ZonedDateTime arraydetails
eachMinuteOfInterval()Get all minutes in an interval as ZonedDateTime arraydetails

Utilities

FunctionDescriptionReference
browserTimezone()Get the browser/device timezonedetails
roundToNearestHour()Round a datetime to the nearest hour boundarydetails
roundToNearestMinute()Round a datetime to the nearest minute boundarydetails
roundToNearestSecond()Round a datetime to the nearest second boundarydetails

Types

import type { Timezone, IANATimezone } from '@gobrand/tiempo';

// Timezone: accepts IANA timezones + "UTC"
const tz: Timezone = 'America/New_York';  // Autocomplete for 400+ timezones

// IANATimezone: strictly IANA identifiers (excludes "UTC")
const iana: IANATimezone = 'Europe/London';

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

PinchTab Browser Ops

Browser automation via PinchTab CLI (nav/snap/find/click/fill/press/text) with low-token accessibility-tree flow. Use when the user asks to operate websites,...

Registry SourceRecently Updated
Coding

Aigames

Create a mini HTML game, organize files in a new folder, and upload it to the brianclan/aigames GitHub repo for www.thenext.games.

Registry SourceRecently Updated
Coding

Api Tester Cn

API请求构造、curl命令生成、Mock数据、API文档、HTTP状态码速查、Headers说明。API request builder, curl generator, mock data, API documentation, HTTP status codes, headers reference. Us...

Registry SourceRecently Updated
Coding

Miaoda App Builder

Create, modify, generate, and deploy websites, web apps, dashboards, SaaS products, internal tools, interactive web pages, Weixin mini program , games on the...

Registry SourceRecently Updated