/** * Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, <code>null</code> is returned. * <p> * If the underlying value is a {@link String}, then attempts will be made to parse the string as though it is in * the GMT {@link TimeZone}. If the {@link TimeZone} is known, call the overload that accepts one as an argument. */ @Nullable public java.util.Date getDate(int tagType) { return getDate(tagType, null, null); }
/** * Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, <code>null</code> is returned. * <p> * If the underlying value is a {@link String}, then attempts will be made to parse the string as though it is in * the {@link TimeZone} represented by the {@code timeZone} parameter (if it is non-null). Note that this parameter * is only considered if the underlying value is a string and it has no time zone information, otherwise it has no effect. */ @Nullable public java.util.Date getDate(int tagType, @Nullable TimeZone timeZone) { return getDate(tagType, null, timeZone); }
/** * Parses the date/time tag, the subsecond tag and the time offset tag to obtain a single Date * object with milliseconds representing the date and time when this image was modified. If * the time offset tag does not exist, attempts will be made to parse the values as though it is * in the {@link TimeZone} represented by the {@code timeZone} parameter (if it is non-null). * * @param timeZone the time zone to use * @return A Date object representing when this image was modified, if possible, otherwise null */ @Nullable public Date getDateModified(@Nullable TimeZone timeZone) { Directory parent = getParent(); if (parent instanceof ExifIFD0Directory) { TimeZone timeZoneModified = getTimeZone(TAG_OFFSET_TIME); return parent.getDate(TAG_DATETIME, getString(TAG_SUBSECOND_TIME), (timeZoneModified != null) ? timeZoneModified : timeZone); } else { return null; } }
/** * Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, <code>null</code> is returned. * <p> * If the underlying value is a {@link String}, then attempts will be made to parse the string as though it is in * the GMT {@link TimeZone}. If the {@link TimeZone} is known, call the overload that accepts one as an argument. */ @Nullable public java.util.Date getDate(int tagType) { return getDate(tagType, null, null); }
/** * Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, <code>null</code> is returned. * <p> * If the underlying value is a {@link String}, then attempts will be made to parse the string as though it is in * the {@link TimeZone} represented by the {@code timeZone} parameter (if it is non-null). Note that this parameter * is only considered if the underlying value is a string and it has no time zone information, otherwise it has no effect. */ @Nullable public java.util.Date getDate(int tagType, @Nullable TimeZone timeZone) { return getDate(tagType, null, timeZone); }
subsecond = exifSubIFDDir.getString(ExifSubIFDDirectory.TAG_SUBSECOND_TIME); value = directory.getDate(tagType, subsecond, timeZone); } else if (directory instanceof ExifSubIFDDirectory) { if (tagType == ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL) { value = directory.getString(tagType, "US-ASCII"); } else if (isDateTag(directory, tagType)) { value = directory.getDate(tagType, timeZone);