
The real "date taken" of JPGs?
As you see the attached image there is a "date taken" for the JPG files. I tried some exif codes but generally gave fault dates (modification date as "date taken"). My capture is from a Turkish Windows Vista Computer but you can see in your computer for a JPG properties. My question is: How can I get this date from C#.


VulpesPosted Oct 4, 2013, 11:54 AM
I hadn't noticed that one before but it's listed here on MSDN:
http://msdn.microsoft.com/en-us/library/ms534416.aspx
and says:
"Date and time when the original image data was generated. For a DSC, the date and time when the picture was taken. The format is YYYY:MM:DD HH:MM:SS with time shown in 24-hour format and the date and time separated by one blank character (0x2000). The character string length is 20 bytes including the NULL terminator. When the field is empty, it is treated as unknown."
Ali GPosted Oct 4, 2013, 11:36 AM
Ali GPosted Oct 4, 2013, 11:15 AM
VulpesPosted Oct 4, 2013, 11:00 AM
If this doesn't give the correct answer then, as long as you have an original copy of the file, you could try the CreationTime property of its FileInfo object:
FileInfo fi = new FileInfo(filePath);
Console.WriteLine(fi.CreationTime.ToLongDateString());