Skip to content

parseMonthFromDateTime

  • The core functions, which every industry uses.
parseMonthFromDateTime(value: string): string

Return the month (1-12) for a given ISO 8601 datetime string.

  • Returns zero-padded string for month.
  • Returns "" for invalid input.
ParameterTypeDescription
valuestringISO datetime string

Month (01-12) or "" on invalid input

import { parseMonthFromDateTime } from "@northguild/gmt/plain/parse";
parseMonthFromDateTime("2024-03-15T12:30:00") // "03"
output 

plain/parse/parseMonthFromDateTime.ts

Accessibility
© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.