How To Properly Put Dates In Photo Files Names

do your photo files have dates in them? They probably should so you can easily track them and know when they were taken even if they are not in their original folder.

How To Properly Put Dates In Photo Files Names

But… the big questions is how do you put the date in the file name? Apparently there are a lot of wrong ways and one right way.

The matter of dating files is not exclusive to photography and since it has such a broad scope there is a standard way of doing it. It is called ISO 8601 (now, don’t get me wrong, you can name your files however you want, I am just saying that this is a standardized, common, clever way of doing it).

The format goes as YYYY-MM-DD where YYYY represents a year with 4 digits e.g. 1984; MM represents a month is two digits (even if it is under 10), e.g. 03 for March; and DD represents the day of the month, again in two digits, e.g. 23.

That means that your file names will start with something like 1984-03-23-and end with something like location-otherinfo.jpg. The entire files name would be 1984-03-23-location-otherinfo.jpg

if you want shorter name you can remove the dashes to have YYYYMMDD (e.g. 19840323). Since each part has a per-determined length, there is no confusion between year, month and day.

If you are not using this format yet, or considering a new format (just for fun), consider this:

  • It is easy to read and easy to write and no “translation” is involved from words like FEB, MAR and so on. So this is easy to export and import
  • It is really easy to sort the files by date, even if their original date was somehow changed (say from bringing a “bad” backup on). Or if you are doing a batch export where all the exported files will have the same “creation date”.
  • It is short and has constant length (either in the long dashed form or in the dash-free form)

Of course the standard has more like, time format (HH:SS) and week of the year, but it is the date part that makes the bigger difference on naming files.

Here are a few “bad” formats:

  • 03-23-1984 – this is not sortable at all. any format that starts with the day will definitely not sort.
  • 1984-23-3 – nope, this one is not constant length and will put 1984-23-11 before 1984-23-2
  • MAR-03-1984 – really introduce letters, really?

So to recap it is YYYY-MM-DD :)

ISO 8601 / ISO 8601

  • joe_average

    er, renaming files manually is futile. so, I’ve been doing folders yyyymmdd for years now. it really helps to organize and find your files. I wrote a program that takes images out of a easy dump folder (6 cameras) and sorts them into the yyyymmdd folders (avoiding filename collisions) automatically. saves a LOT of time!
    anyone else have software organizing suggestion (aside from lightroom or picasa)?

  • catlett

    I always rename them in a very similar way but a bit more unique to allow for multi-camera shoots. Using Photo Mechanic to rename during ingest in the format {year4}{month0}{day0}_{hour24}{minute}{second}{subsecond}_001.ext (That does translate to something like 20130909_12342550_001.NEF) It also puts them into dated folders as Joe suggests. At the time of ingestion I also have Photo Mechanic fill the basic keyword metadata. This does a few things that might not be obvious. If you ever need to copy the files to another folder it makes it almost impossible to have to deal with duplicate file names. If you happened to have 2 different cameras that created a file DSC0003.NEF then they would cause a problem if you tried to copy them into the same folder. Adding the keywords then allows you to use a catalog program like (e.g. Lightroom) to search for specific keywords. If you apply keywords consistently, e.g. birthday, New Years, home, work, vacation, etc. then you can easily view things in different ways, much like hashtags in Twitter.

  • Renato Murakami

    That’s the way I’ve been doing for years… anyways, it works both if you want to rename individual files or if you want to separate by folders.
    Good information to pass around, as it’s become a standard of sorts. Some cameras already do it (or has an option to do it) automatically.

  • msundman

    I made a script that does all kinds of things to my new photos. It removes the embedded thumbnail, losslessly rotates the photo according to the orientation sensor info in the exif and finally renames to yyyymmdd-HHMMSS.ext. If there turns out to be more than one picture at the same second it makes all of them named yyyymmdd-HHMMSS,n.ext where n is a number 0-9, or if there are more than 100 then yyyymmdd-HHMMSS,nn.ext, etc.
    Also if there are other files with the same original name, but different extension (such as a video clip or a raw file), in the same directory then it renames those the same way as the jpeg file.

  • Gray_

    I use “Joe” for all the renaming-things.

    A very clever and powerful tool:

  • João Almeida

    To sum things up: US date notation is silly.

    • John Driggers

      Huh…where did that come from? What does US date notation have to do with the MANY examples of how not to do it (single digit days or months, using letter abbreviations for months). Sure, US date notation is one way it won’t work, but it hardly qualifies as THE SUMMARY or make’s it silly. Probably wouldn’t use the Mayan calendar either for that matter. Or Spanish named months.

  • Some way of life.

    Why rename files with the date when this information is already in the metadata? You can view the date taken in a file browser, and sort on that column. I usually don’t bother to rename files unless I am exporting them from Lightroom for other purposes. Then I am more likely to use another field (title, keywords, etc) for appending to the file name. I might use the date, but again it always feels redundant.

    • gheedsgreed

      If you don’t use custom file names, there is always the danger of running to overlapping names. Photos come from multiple sources, devices can recycle names, so you want to avoid overwriting any of your precious photos.

  • Casey

    I’ve been using the program “NameExif” for a couple of years now. It is simple, works great and is free.

  • Jon Decker

    I don’t denote contextual information (Bob-Birthday, Eiffel-Tower, etc.) in the file name anymore as they might get licensed for unrelated topics. Instead, all my files are named as follows: yyyymmdd_hhmmss-seq.* – which means the only words that make it into the file name are sequential edit revision designations. Am I nuts?