A photo’s name should be its date.

An open source command line tool that renames photos by date taken.

Install

One day, three devices, sorted by name

  1. A croissant on a cafe table
    DSC_0412.JPG2024-08-17_09-15-33.JPG Camera
  2. Boats on an estuary at dusk
    DSC_0419.JPG2024-08-17_20-37-46.JPG Camera
  3. Morning mist on a mountain lake
    IMG_2207.JPG2024-08-17_07-42-10.JPG Phone
  4. People wading at sunset
    IMG_2231.JPG2024-08-17_19-51-04.JPG Phone
  5. A cyclist passing a brick wall
    P1030218.JPG2024-08-17_13-08-51.JPG Second camera
  6. An old town street at night
    P1030244.JPG2024-08-17_22-04-17.JPG Second camera

Biggest unit first, so it sorts

Year, month, day, then the time: sort by name and you get shutter order.

2024-08-17_ year month day
19-51-04.JPG hour minute second

Once called IMG_2231.JPG, from the phone.

Morning mist on a still mountain lake, pines and peaks reflected
IMG_2207.JPG, from the phone

The shutter’s date, not the copy’s

Date taken
Written by the phone as the shutter fired. It travels inside the photo.
Date modified
The evening it was copied off the phone. Copies can change it.

Plain ls, in shutter order

Past midnight too, because the day comes before the hour.

$ ls -1 2024-trip
DSC_0398.JPG
DSC_0412.JPG
DSC_0419.JPG
IMG_2189.JPG
IMG_2207.JPG
IMG_2231.JPG
P1030201.JPG
P1030218.JPG
P1030244.JPG
$ whenshot 2024-trip
$ ls -1 2024-trip
2024-08-16_21-30-12.JPG
2024-08-16_23-58-40.JPG
2024-08-17_00-03-05.JPG
2024-08-17_07-42-10.JPG
2024-08-17_09-15-33.JPG
2024-08-17_13-08-51.JPG
2024-08-17_19-51-04.JPG
2024-08-17_20-37-46.JPG
2024-08-17_22-04-17.JPG
An example session over two days of photos.

Try it on a copied folder first

$ install command to come
$ cp -R 2024-trip trip-test
$ whenshot trip-test

Source code: repository link to come