Skip to main content

Module date

Module date 

Source
Expand description

The day a photo or video was taken, which decides its album.

In order of preference:

  1. EXIF DateTimeOriginal (or DateTimeDigitized): JPEG, HEIC, PNG, TIFF and RAW files. Camera wall-clock time, used as is.
  2. QuickTime/MP4 metadata: Apple’s com.apple.quicktime.creationdate (local time), else the movie header’s creation time (UTC, shown in the local time zone, i.e. TZ).
  3. A date in the file name (IMG_20140712_…, 2014-07-12 …, IMG-20140712-WA0001, FB_IMG_1405171391000).
  4. EXIF DateTime (when the file was last written, often by an editor or scanner, so a weaker hint than the name).
  5. The file’s modification time.

Enums§

DateSource
Where a file’s date came from.

Functions§

capture_date
path’s capture date. data is the whole file when the caller already has it in memory (RAW files, which are read whole anyway); otherwise only the parts holding metadata are read.
file_name_date
A date in a file name: eight digits (20140712) or year, month and day split by -, _ or . (2014-07-12), not part of a longer number; or a Unix timestamp in milliseconds or seconds (1405171391000), as Facebook and some messengers name files.
metadata_date
The date from metadata alone (EXIF or video), for dating a Live Photo video by its photo.