Skip to content

maxDateTime

  • The core functions, which every industry uses.
maxDateTime(dateTimes: string[]): string | null

Return the latest (maximum) of the given PlainDateTime values.

  • Returns null if the array is empty or contains no valid datetimes.
  • Validation is performed on each item in the array.
ParameterTypeDescription
dateTimesstring[]Array of ISO PlainDateTime strings (e.g. “2024-03-10T12:00:00”)

The latest datetime string, or null on invalid input

import { maxDateTime } from "@northguild/gmt/plain/calculate";
maxDateTime(["2024-03-10T12:00:00", "2024-03-15T12:00:00", "2024-03-12T12:00:00"]) // "2024-03-15T12:00:00"
dateTimes
output 

plain/calculate/maxDateTime.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.