parseSecondFromDateTime
Signature
Section titled “Signature”parseSecondFromDateTime(value: string): stringimport { parseSecondFromDateTime } from "@northguild/gmt/plain/parse";Return the second (0-59) for a given ISO 8601 datetime string.
- Returns zero-padded string for second.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO datetime string |
Returns
Section titled “Returns”Second (00-59) or “” on invalid input
Examples
Section titled “Examples”parseSecondFromDateTime("2024-03-15T14:30:45") // "45"parseSecondFromDateTime("2024-03-15T14:30:00") // "00"parseSecondFromDateTime("invalid") // ""