Software dateformat

Started by Nero, July 07, 2024, 12:55:58 PM

Previous topic - Next topic

Nero

Hi all,

I have a few images modified trough Adobe Photoshop.
I notice that the DateTimeOriginal and the CreateDate tags are in YYYYmmdd HHMMSS format, without separating colons.
How can I change these in the standard %Y:%m:%d %H:%M:%S format without entering those manually?


BTW, this forum seems to be a year ahead: The News message in the upper right corner says

News: 2025-06-13: ExifTool 12.87 is now available
OS: Debian Bookworm LXDE
Exiftool ver: 12.57

StarGeek

Are you using exiftool or some other program to look at those time stamps? Use this command to look at all the time stamps and verify that there is a problem.
exiftool -time:all -G1 -a -s file.jpg

If there is a problem, you can just copy the tags back onto themselves and exiftool will correct them (see FAQ #5)

This command uses the AllDates shortcut which is made up of the three most common EXIF timestamps, CreateDate, DateTimeOriginal, and ModifyDate.
exiftool -TagsFromFile @ -AllDates /path/to/files/
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Nero

Thanks for your reply.

I noticed that those files, ±50, are not processed by Exiftool to move them in a Model/Year/Month structure.

$ exiftool -time:all -G1 -a -s seg/aardbeien.jpg
[System]        FileModifyDate                  : 2004:07:12 12:38:20+02:00
[System]        FileAccessDate                  : 2024:07:07 18:04:47+02:00
[System]        FileInodeChangeDate             : 2024:07:07 18:04:38+02:00
[IFD0]          ModifyDate                      : 2003:05:24 23:10:01
[ExifIFD]       DateTimeOriginal                : 20021005 110144
[ExifIFD]       CreateDate                      : 20021005 110144
[IPTC]          DateCreated                     : 2002:10:05
[XMP-photoshop] DateCreated                     : 2002:10:05

I guess those faulty timestamps are the reason.

Result of exiftool -TagsFromFile @ -AllDates seg/

$ exiftool -TagsFromFile @ -AllDates seg/
Warning: Month '00' out of range 1..12 in ExifIFD:DateTimeOriginal (PrintConvInv) - seg/oude auto.jpg
Warning: No writable tags set from seg/oude auto.jpg
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv) - seg/gevangene.jpg
Warning: [minor] Entries in ExifIFD were out of sequence. Fixed. - seg/gevangene.jpg
Warning: Invalid date/time (use YYYY:mm:dd HH:MM:SS[.ss][+/-HH:MM|Z]) in ExifIFD:DateTimeOriginal (PrintConvInv) - seg/hond2.jpg
Warning: Month '00' out of range 1..12 in ExifIFD:DateTimeOriginal (PrintConvInv) - seg/klas (8).JPG
Warning: No writable tags set from seg/klas (8).JPG
Warning: Month '00' out of range 1..12 in ExifIFD:DateTimeOriginal (PrintConvInv) - seg/kelken.jpg

Some files were processed, like the one on top of this reply, others have still wrong date formats.

$ exiftool -s -common seg/
======== seg/oude auto.jpg
FileName                        : oude auto.jpg
FileSize                        : 84 kB
Model                           : E775
DateTimeOriginal                : 0000:00:00 00:00:00
ImageSize                       : 700x571
FocalLength                     : 5.8 mm
ShutterSpeed                    : 1/129
Aperture                        : 7.9
ISO                             : 100
Flash                           : No Flash
======== seg/afbrokkelen.jpg
FileName                        : afbrokkelen.jpg
FileSize                        : 147 kB
Model                           : Canon PowerShot S45
ImageSize                       : 670x428
======== seg/gevangene.jpg
FileName                        : gevangene.jpg
FileSize                        : 83 kB
Model                           : SP-1500
DateTimeOriginal                :     :  :     :  :
ImageSize                       : 450x600
======== seg/hond2.jpg
FileName                        : hond2.jpg
FileSize                        : 128 kB
Model                           : SP-2000
DateTimeOriginal                :     :  :     :  :
ImageSize                       : 783x450
======== seg/klas (8).JPG
FileName                        : klas (8).JPG
FileSize                        : 1527 kB
Model                           : FE170,X760
DateTimeOriginal                : 0000:00:00 00:00:00
ImageSize                       : 2816x2112
Quality                         : HQ (Normal)
FocalLength                     : 6.3 mm
ShutterSpeed                    : 1/30
Aperture                        : 3.1
ISO                             : 125
WhiteBalance                    : Auto
Flash                           : Auto, Fired
======== seg/kelken.jpg
FileName                        : kelken.jpg
FileSize                        : 121 kB
Model                           : C2040Z
DateTimeOriginal                : 0000:00:00 00:00:00
ImageSize                       : 420x560
FocalLength                     : 21.0 mm
ShutterSpeed                    : 1/100
Aperture                        : 2.6
ISO                             : 100
Flash                           : Fired

I have limited the outputs for readabylity.

Should I use FileModifyDate for the files lacking a proper exif date?

OS: Debian Bookworm LXDE
OS: Debian Bookworm LXDE
Exiftool ver: 12.57

StarGeek

Yeah, time stamps such as "20021005 110144" are incorrect, but exiftool should fix those with the above command.

A time stamp of "0000:00:00 00:00:00" is bad and that is why you get the Month '00' out of range warnings.  There's no such thing as month 0 or day 0. For those files, you'll have to add the time.

You can use the FileModifyDate, but that tag isn't always accurate.  You have to decide on an individual case or just use it because it's better than nothing. You could do it in batch with
exiftool -P "-AllDates<FileModifyDate" /path/to/files/
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Nero

Thanks, I'll use that last command for remaining images.
OS: Debian Bookworm LXDE
Exiftool ver: 12.57