def extract_capture_time(self):
        '''
        Extract capture time from EXIF
        return a datetime object
        TODO: handle GPS DateTime
        '''
        time_string = exif_datetime_fields()[0]
        capture_time, time_field = self._extract_alternative_fields(
            time_string, 0, str)
        if time_field in exif_gps_date_fields()[0]:
            capture_time = self.extract_gps_time()
            return capture_time

        if capture_time is 0:
            # try interpret the filename
            try:
                capture_time = datetime.datetime.strptime(os.path.basename(
                    self.filename)[:-4] + '000', '%Y_%m_%d_%H_%M_%S_%f')
            except:
                return None
        else:
            capture_time = capture_time.replace(" ", "_")
            capture_time = capture_time.replace(":", "_")
            capture_time = capture_time.replace(".", "_")
            capture_time = capture_time.replace("-", "_")
            capture_time = capture_time.replace(",", "_")
            capture_time = "_".join(
                [ts for ts in capture_time.split("_") if ts.isdigit()])
            capture_time, subseconds = format_time(capture_time)
            sub_sec = "0"
            if not subseconds:
                sub_sec = self.extract_subsec()
            capture_time = capture_time + \
                datetime.timedelta(seconds=float("0." + sub_sec))

        return capture_time
Extract capture time from EXIF
        return a datetime object
        TODO: handle GPS DateTime