本文整理了Java中org.apache.kylin.common.util.DateFormat.dateToString()
方法的一些代码示例,展示了DateFormat.dateToString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateFormat.dateToString()
方法的具体详情如下:
包路径:org.apache.kylin.common.util.DateFormat
类名称:DateFormat
方法名:dateToString
暂无
代码示例来源:origin: apache/kylin
public static boolean isInputFormatDate(String dateStr, String formatStr) {
try {
return dateStr.equals(dateToString(stringToDate(dateStr, formatStr), formatStr));
} catch (Exception ex) {
return false;
}
}
代码示例来源:origin: apache/kylin
public static boolean isSupportedDateFormat(String dateStr) {
assert dateStr != null;
for (String formatStr : SUPPORTED_DATETIME_PATTERN) {
try {
if (dateStr.equals(dateToString(stringToDate(dateStr, formatStr), formatStr))) {
return true;
}
} catch (Exception ex) {
continue;
}
}
return false;
}
代码示例来源:origin: apache/kylin
@Override
final protected String getValueFromIdImpl(int id) {
if (id < baseId || id > maxId)
throw new IllegalArgumentException("ID '" + id + "' is out of range [" + baseId + "," + maxId + "]");
long millis = DateDimEnc.getMillisFromNumOfDaysSince0000(calcSeqNoFromId(id));
return dateToString(new Date(millis), pattern);
}
代码示例来源:origin: org.apache.kylin/kylin-common
public static String dateToString(Date date) {
return dateToString(date, DEFAULT_DATETIME_PATTERN_WITHOUT_MILLISECONDS);
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
public static boolean isInputFormatDate(String dateStr, String formatStr) {
try {
return dateStr.equals(dateToString(stringToDate(dateStr, formatStr), formatStr));
} catch (Exception ex) {
return false;
}
}
代码示例来源:origin: org.apache.kylin/kylin-core-common
public static boolean isSupportedDateFormat(String dateStr) {
assert dateStr != null;
for (String formatStr : SUPPORTED_DATETIME_PATTERN) {
try {
if (dateStr.equals(dateToString(stringToDate(dateStr, formatStr), formatStr))) {
return true;
}
} catch (Exception ex) {
continue;
}
}
return false;
}
代码示例来源:origin: org.apache.kylin/kylin-core-dictionary
@Override
final protected String getValueFromIdImpl(int id) {
if (id < baseId || id > maxId)
throw new IllegalArgumentException("ID '" + id + "' is out of range [" + baseId + "," + maxId + "]");
long millis = DateDimEnc.getMillisFromNumOfDaysSince0000(calcSeqNoFromId(id));
return dateToString(new Date(millis), pattern);
}
代码示例来源:origin: org.apache.kylin/kylin-dictionary
@Override
final protected String getValueFromIdImpl(int id) {
if (id < baseId || id > maxId)
throw new IllegalArgumentException("ID '" + id + "' is out of range [" + baseId + "," + maxId + "]");
Date d = getDateFromNumOfDaysSince0000(calcSeqNoFromId(id));
return DateFormat.dateToString(d, pattern);
}
内容来源于网络,如有侵权,请联系作者删除!