convertUtcToPlainTime
Signature
Section titled “Signature”convertUtcToPlainTime(value: string, options?: { timeZone?: string; }): stringimport { convertUtcToPlainTime } from "@northguild/gmt/utc/convert";Convert a UTC datetime string to a plain time string in the format “HH:mm:ss”.
- Converts to specified timezone before extracting time.
- Defaults to UTC if no timezone specified.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
UTC datetime string (e.g., “2024-02-29T00:00:00Z”) |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
timeZone? |
string |
— |
Returns
Section titled “Returns”plain time string in “HH:mm:ss” format or “” on invalid input
Examples
Section titled “Examples”convertUtcToPlainTime("2024-02-29T00:00:00Z") // "00:00:00"convertUtcToPlainTime("2024-02-29T00:00:00Z", { timeZone: "America/New_York" }) // "19:00:00"convertUtcToPlainTime("invalid") // ""