Skip to content

isValidMetarTime

  • Airline schedule dates in IATA SSIM files, METAR and TAF report times with no month, and NOTAM validity times.
isValidMetarTime(value: string, referenceInstant: string): boolean

Return true when value is a METAR, SPECI or TAF time group (YYGGggZ) that resolves against referenceInstant.

  • True exactly when parseMetarTime returns an instant for the same arguments. It calls the parser, so the two cannot disagree.
  • It needs the reference. The group has no month or year, so a well-formed group against a reference that is not an ISO 8601 instant is false.
  • UTC, no locale. The group is read as fixed ASCII text in UTC, never through Intl.
ParameterTypeDescription
valuestringThe value to check
referenceInstantstringAn ISO 8601 instant with Z or an offset: the time the report was received or the archive’s timestamp

true for a time group that resolves against the reference, or false on invalid input

import { isValidMetarTime } from "@northguild/gmt/aviation/validate";
isValidMetarTime("302350Z", "2024-07-01T00:05:00Z") // true
output 

aviation/validate/isValidMetarTime.ts

© 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.