Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/complaindate/support/timeParts.ts>timeParts

JavaScript date-time utilities that keep timezones on the surface
Latest
function timeParts
import { timeParts } from "https://deno.land/x/complaindate@v1.0.1/support/timeParts.ts";

Extract hour, minute, second & millisecond from an ISO 8601 string representation of a time.

hh:mm:ss.sss and Thhmmss.sss are the full formats. Shorter strings are handled down to hh:mm and Thh.

  • Ignores any date or timezone information in the given string

Parameters

isoTimeString: string

A string containing an ISO 8601 time

Returns

{ hour: number; minute: number; second?: number; millisecond?: number; } | null

An object containing hour, minute, second & millisecond properties extracted from the string