Is there any syntax like Date(Year) grabbing the year part of the exif data (DateAndTimePictureTaken) (For example: "2013:07:12 11:10:20") which is obtained such codes:
FileInfo[] files = new DirectoryInfo(pathname).GetFiles("*.JPG");
for (int i = 0; i < files.Length; i++)
{
string DateAndTimePictureTaken = string.Empty;
Image image = new Bitmap(@files[i].FullName);
foreach (PropertyItem propItem in image.PropertyItems)
{
if (propItem.Id == 0x0132)
{
DateAndTimePictureTaken = (new System.Text.ASCIIEncoding()).GetString(propItem.Value);
..................
................
Is there any syntax like Date(Year)?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Sunny SharmaRank #223 · 11.1K pointsPosted Sep 28, 2013, 2:06 AM EDT
How about grabbing it this way:
---------------------------------
string DateAndTimePictureTaken ="2013:07:12 11:10:20";
string Year =DateAndTimePictureTaken.Substring(0,4);
---------------------------------
Happy Coding :)