Returns the difference between this ClockTime and another in the specified unit(s). Supports microsecond precision when 'microseconds' is included in the unit parameter.
Object with only the specified units (or all units if not specified)
const t1 = ClockTime.fromObject({ hour: 15, minute: 30 })
const t2 = ClockTime.fromObject({ hour: 14, minute: 0 })
t1.diff(t2, 'hours') // { hours: 1 }
t1.diff(t2, ['hours', 'minutes']) // { hours: 1, minutes: 30 }
t1.diff(t2) // { hours: 1, minutes: 30, seconds: 0, milliseconds: 0, microseconds: 0 }
Returns true if this ClockTime equals another ClockTime.
true if times are equal
Returns a new ClockTime with the given time units set.
Object with time units to set (hour, minute, second, millisecond, microsecond)
A new ClockTime
Returns the underlying DateTime instance.
A DateTime representing this time with zone
Returns the time as an ISO 8601 time string without timezone offset.
Alias for toISOTime().
Optionalopts: {Optional format options
Optionalformat?: "basic" | "extended"Format variant: 'basic' (compact) or 'extended' (default, with colons)
OptionalsuppressMilliseconds?: booleanIf true, omits milliseconds/microseconds when they are zero
OptionalsuppressSeconds?: booleanIf true, omits seconds when they are zero
ISO time string without timezone offset (e.g., '14:30:45.123456')
Returns the time as an ISO 8601 time string with timezone offset.
Alias for toISO().
Optionalopts: {Optional format options
Optionalformat?: "basic" | "extended"Format variant: 'basic' (compact) or 'extended' (default, with colons)
OptionalsuppressMilliseconds?: booleanIf true, omits milliseconds/microseconds when they are zero
OptionalsuppressSeconds?: booleanIf true, omits seconds when they are zero
ISO time string with timezone offset (e.g., '14:30:45.123456-05:00')
Returns a localized string representation of the time.
OptionalformatOpts: DateTimeFormatOptionsIntl.DateTimeFormat options for formatting
Optionalopts: LocaleOptionsOptional locale configuration
Locale string (e.g., 'en-US', 'fr-FR')
Numbering system (e.g., 'arab', 'beng')
Calendar system (e.g., 'islamic', 'hebrew')
Localized time string
Alias of toSQL.
Returns the SQL time string without timezone offset.
Result is memoized for performance.
SQL time string without timezone offset (e.g., '14:30:45.123456')
ProtectedwrapStaticfromStaticfromCreate a ClockTime from a custom format string. Uses Luxon format tokens (e.g., 'HH:mm:ss', 'hh:mm a').
The string to parse
Format string using Luxon tokens
Optionalopts: LocaleOptionsOptional configuration
Locale for parsing (e.g., 'en-US', 'fr-FR')
Numbering system (e.g., 'arab', 'beng')
Output calendar system (e.g., 'islamic', 'hebrew')
A ClockTime for the parsed time
StaticfromCreate a ClockTime from an ISO 8601 time string. Preserves the time values as-is, regardless of any timezone info in the string.
ISO time string (e.g., '14:30:45.123456')
A ClockTime for the given time
StaticfromCreate a ClockTime from a JavaScript Date.
A JavaScript Date instance
A ClockTime for the time portion
StaticfromCreate a ClockTime from an object with time units.
Object with hour, minute, second, millisecond, microsecond properties
Optionalopts: LocaleOptionsOptional configuration
Locale (e.g., 'en-US', 'fr-FR')
Numbering system (e.g., 'arab', 'beng')
Output calendar system (e.g., 'islamic', 'hebrew')
A ClockTime for the given components
StaticfromCreate a ClockTime from an SQL time string. Preserves the time values as-is, regardless of any timezone info in the string.
SQL time string (e.g., '14:30:45.123456')
A ClockTime for the given time
StaticmaxReturns the latest ClockTime/ClockTimeTz from the given arguments.
The latest ClockTime/ClockTimeTz
StaticminReturns the earliest ClockTime/ClockTimeTz from the given arguments.
The earliest ClockTime/ClockTimeTz
StaticnowProtected Staticwrap
ClockTime represents a time of day without timezone information.
Useful for representing TIME WITHOUT TIME ZONE fields from a Postgres database. All output methods strip timezone offset information.