date-vir - v9.4.1
    Preparing search index...

    Function dateOnlyUtcIsoStringToFullDate

    • Converts a DateOnlyUtcIsoString into a FullDate at the start of that same calendar day in the given timezone. The calendar day never shifts. The start of a day is usually midnight but can be later in timezones that have had a DST transition at midnight.

      Type Parameters

      • const SpecificTimezone extends Timezone

      Parameters

      Returns {
          day: DayOfMonth;
          hour: Hour;
          millisecond: number;
          minute: Minute;
          month: MonthNumber;
          second: Minute;
          timezone: SpecificTimezone;
          year: number;
      }

      • day: DayOfMonth

        A day of the month: 1-31 depending on the month

      • hour: Hour

        Hour of the day in 24 time: 0-23

      • millisecond: number

        Millisecond of the second: 0-999

      • minute: Minute

        Minute of the hour: 0-59

      • month: MonthNumber

        A month of the year: 1-12

      • second: Minute
      • timezone: SpecificTimezone
      • year: number

        The full, four digit year.

        2023;
        
      import {
      createUtcFullDate,
      dateOnlyUtcIsoStringToFullDate,
      TimezoneName,
      toDateOnlyUtcIsoString,
      } from 'date-vir';

      const day = toDateOnlyUtcIsoString(createUtcFullDate('2026-10-02T00:00:00.000Z'));

      dateOnlyUtcIsoStringToFullDate(day, TimezoneName['America/Denver']);
      // outputs `{year: 2026, month: 10, day: 2, hour: 0, minute: 0, second: 0, millisecond: 0, timezone: 'America/Denver'}`