Timestamp Object

Timestamp objects are immutable plain objects with calendar date fields and optional time fields. The standard parser helpers produce Gregorian fields. Calendar adapter helpers can produce the same shape with adapter fields and a calendarId.

import type { type CalendarId = "gregorian" | (string & {})
Stable identifier for a calendar implementation. The built-in Gregorian adapter uses `gregorian` as its package-facing id and `gregory` as its Intl calendar id.
CalendarId
} from '@timestamp-js/core'
export interface Timestamp { readonly Timestamp.calendarId?: CalendarId | undefinedcalendarId?: type CalendarId = "gregorian" | (string & {})
Stable identifier for a calendar implementation. The built-in Gregorian adapter uses `gregorian` as its package-facing id and `gregory` as its Intl calendar id.
CalendarId
readonly Timestamp.date: stringdate: string readonly Timestamp.hasDay: booleanhasDay: boolean readonly Timestamp.year: numberyear: number readonly Timestamp.month: numbermonth: number readonly Timestamp.day: numberday: number readonly Timestamp.time?: string | undefinedtime?: string readonly Timestamp.hasTime: booleanhasTime: boolean readonly Timestamp.hour: numberhour: number readonly Timestamp.minute: numberminute: number readonly Timestamp.second?: number | undefinedsecond?: number readonly Timestamp.millisecond?: number | undefinedmillisecond?: number readonly Timestamp.timezone?: string | undefinedtimezone?: string readonly Timestamp.weekday?: number | undefinedweekday?: number readonly Timestamp.doy?: number | undefineddoy?: number readonly Timestamp.workweek?: number | undefinedworkweek?: number readonly Timestamp.past?: boolean | undefinedpast?: boolean readonly Timestamp.current?: boolean | undefinedcurrent?: boolean readonly Timestamp.future?: boolean | undefinedfuture?: boolean readonly Timestamp.disabled?: boolean | undefineddisabled?: boolean }

Important fields

FieldMeaning
calendarIdOptional calendar-system id for adapter-produced timestamps.
dateCalendar date string in YYYY-MM-DD form when present.
timeTime string formatted as HH:mm, HH:mm:ss, or HH:mm:ss.SSS.
hasDayTrue when the timestamp includes a meaningful date/day value.
hasTimeTrue when the timestamp includes time fields.
weekdayWeekday number where Sunday is 0 and Saturday is 6.
doyDay of the year.
workweekWeek number metadata for the timestamp calendar.
timezonePreserved timezone suffix such as Z, +06:00, or -0700.
pastTrue when the timestamp is before a comparison timestamp.
currentTrue when the timestamp matches a comparison timestamp.
futureTrue when the timestamp is after a comparison timestamp.
disabledTrue when this timestamp represents a disabled date.

Hover documentation

The source is documented with TypeScript/JSDoc comments so editors can show field and helper details on hover.