Skip to content

startOfQuarterForDateTime

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

Return the start of the quarter for a given ISO datetime.

  • Returns the first day of the quarter with time set to 00:00:00.
  • Resets every time field, including milliseconds, microseconds and nanoseconds.
  • Q1 returns “01-01T00:00:00”, Q2 returns “04-01T00:00:00”, etc.
  • Validates input using isValidDateTime.
ParameterTypeDescription
valuestringISO PlainDateTime string

ISO PlainDateTime string for the start of the quarter, or "" on invalid input

import { startOfQuarterForDateTime } from "@northguild/gmt/plain/calculate";
startOfQuarterForDateTime("2024-03-15T12:00:00") // "2024-01-01T00:00:00"
output 

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