本文整理了Java中com.drew.metadata.Directory.getDate()
方法的一些代码示例,展示了Directory.getDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Directory.getDate()
方法的具体详情如下:
包路径:com.drew.metadata.Directory
类名称:Directory
方法名:getDate
[英]Returns the specified tag's value as a java.util.Date. If the value is unset or cannot be converted, null
is returned.
If the underlying value is a String, then attempts will be made to parse the string as though it is in the GMT TimeZone. If the TimeZone is known, call the overload that accepts one as an argument.
[中]以java格式返回指定标记的值。util。日期如果该值未设置或无法转换,则返回null
。
如果基础值是字符串,则将尝试解析字符串,就像它在GMT时区一样。如果时区已知,则调用将其作为参数接受的重载。
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* 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);
}
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* 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);
}
代码示例来源:origin: drewnoakes/metadata-extractor
/**
* 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;
}
}
代码示例来源:origin: apache/tika
original = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
Date datetime = directory.getDate(ExifIFD0Directory.TAG_DATETIME);
if (datetime != null) {
String datetimeNoTimeZone = dateUnspecifiedTz.format(datetime);
代码示例来源:origin: com.drewnoakes/metadata-extractor
/**
* 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);
}
代码示例来源:origin: com.drewnoakes/metadata-extractor
/**
* 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);
}
代码示例来源:origin: org.apache.tika/tika-parsers
original = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
Date datetime = directory.getDate(ExifIFD0Directory.TAG_DATETIME);
if (datetime != null) {
String datetimeNoTimeZone = dateUnspecifiedTz.format(datetime);
代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers
original = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
Date datetime = directory.getDate(ExifIFD0Directory.TAG_DATETIME);
if (datetime != null) {
String datetimeNoTimeZone = dateUnspecifiedTz.format(datetime);
代码示例来源:origin: org.apache.drill.exec/drill-java-exec
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);
内容来源于网络,如有侵权,请联系作者删除!