exiftool-vendored
    Preparing search index...

    Class ExifDateTime

    Encapsulates encoding and decoding EXIF date and time strings, along with timezone handling functionality.

    Key features:

    • Parses datetime strings in various formats (EXIF strict/loose, ISO)
    • Supports timezone inference, conversion, and matching between dates
    • Preserves original string representations when available
    • Provides conversion to/from multiple datetime formats (Luxon DateTime, JS Date, ISO strings)
    • Supports serialization/deserialization via JSON (see ExifDateTime.fromJSON)

    EXIF datetime strings don't typically include timezone information. This class provides mechanisms to associate timezone data from other EXIF tags (like GPS position or timezone offset), and distinguishes between explicitly set and inferred timezone information.

    Index

    Constructors

    • Parameters

      • year: number
      • month: number
      • day: number
      • hour: number
      • minute: number
      • second: number
      • Optionalmillisecond: number
      • OptionaltzoffsetMinutes: number
      • OptionalrawValue: string
      • OptionalzoneName: string
      • OptionalinferredZone: boolean

      Returns ExifDateTime

    Properties

    day: number
    hour: number
    inferredZone?: boolean
    millisecond?: number
    minute: number
    month: number
    rawValue?: string
    second: number
    tzoffsetMinutes?: number
    year: number
    zone: Maybe<string>
    zoneName?: string

    Accessors

    Methods

    • CAUTION: This instance will inherit the system timezone if this instance has an unset zone (as Luxon doesn't support "unset" timezones)

      Parameters

      • OptionaloverrideZone: Maybe<string>

      Returns DateTime

    • Returns {
          _ctor: string;
          day: number;
          hour: number;
          inferredZone: undefined | boolean;
          millisecond: undefined | number;
          minute: number;
          month: number;
          rawValue: undefined | string;
          second: number;
          tzoffsetMinutes: undefined | number;
          year: number;
          zoneName: undefined | string;
      }

    • Parameters

      • dt: Maybe<DateTime<boolean>>
      • Optionalopts: {
            inferredZone?: Maybe<boolean>;
            rawValue?: Maybe<string>;
            unsetMilliseconds?: boolean;
        }

      Returns Maybe<ExifDateTime>

    • Try to parse a date-time string from EXIF. If there is not both a date and a time component, returns undefined.

      Parameters

      • text: string

        from EXIF metadata

      • OptionaldefaultZone: Maybe<string>

        a "zone name" to use as a backstop, or default, if text doesn't specify a zone. This may be IANA-formatted, like "America/Los_Angeles", or an offset, like "UTC-3". See offsetMinutesToZoneName.

      Returns Maybe<ExifDateTime>

    • Parse the given date-time string, EXIF-formatted.

      Parameters

      • text: unknown

        from EXIF metadata, in y:M:d H:m:s format (with optional sub-seconds and/or timezone)

      • OptionaldefaultZone: Maybe<string>

        a "zone name" to use as a backstop, or default, if text doesn't specify a zone. This may be IANA-formatted, like "America/Los_Angeles", or an offset, like "UTC-3". See offsetMinutesToZoneName.

      Returns Maybe<ExifDateTime>

    • Parameters

      • json: Omit<
            {
                _ctor: string;
                day: number;
                hour: number;
                inferredZone: undefined
                | boolean;
                millisecond: undefined | number;
                minute: number;
                month: number;
                rawValue: undefined | string;
                second: number;
                tzoffsetMinutes: undefined | number;
                year: number;
                zoneName: undefined | string;
            },
            "_ctor",
        >

      Returns ExifDateTime

      a new ExifDateTime from the given JSON. Note that this instance may not be valid.

    • Create an ExifDateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.

      Parameters

      • millis: number

        a number of milliseconds since 1970 UTC

      • options: DateTimeJSOptions & { rawValue?: string } = {}
        • rawValue

          the original parsed string input

        • zone

          the zone to place the DateTime into. Defaults to 'local'.

        • locale

          a locale to set on the resulting DateTime instance

        • outputCalendar

          the output calendar to set on the resulting DateTime instance

        • numberingSystem

          the numbering system to set on the resulting DateTime instance

        • OptionalrawValue?: string

          the original parsed string input

      Returns ExifDateTime