parseMonthFromDateTime
Signature
Section titled “Signature”parseMonthFromDateTime(value: string): stringimport { parseMonthFromDateTime } from "@northguild/gmt/plain/parse";Return the month (1-12) for a given ISO 8601 datetime string.
- Returns zero-padded string for month.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO datetime string |
Returns
Section titled “Returns”Month (01-12) or “” on invalid input
Examples
Section titled “Examples”parseMonthFromDateTime("2024-03-15T12:30:00") // "03"parseMonthFromDateTime("invalid") // ""