Ali G

Ali G

  • NA
  • 51
  • 38.5k

Is there any syntax like Date(Year)?

Sep 28 2013 5:59 AM
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);
..................
................

Answers (1)