/**
Sets the DateFormat used to format date and time in the time zone
determined by <code>timeZone</code> parameter. The {@link DateFormat} used
will depend on the <code>dateFormatType</code>.
<p>The recognized types are {@link #NULL_DATE_FORMAT}, {@link
#RELATIVE_TIME_DATE_FORMAT} {@link
AbsoluteTimeDateFormat#ABS_TIME_DATE_FORMAT}, {@link
AbsoluteTimeDateFormat#DATE_AND_TIME_DATE_FORMAT} and {@link
AbsoluteTimeDateFormat#ISO8601_DATE_FORMAT}. If the
<code>dateFormatType</code> is not one of the above, then the
argument is assumed to be a date pattern for {@link
SimpleDateFormat}.
*/
public
void setDateFormat(String dateFormatType, TimeZone timeZone) {
if(dateFormatType == null) {
this.dateFormat = null;
return;
}
if(dateFormatType.equalsIgnoreCase(NULL_DATE_FORMAT)) {
this.dateFormat = null;
} else if (dateFormatType.equalsIgnoreCase(RELATIVE_TIME_DATE_FORMAT)) {
this.dateFormat = new RelativeTimeDateFormat();
} else if(dateFormatType.equalsIgnoreCase(
AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT)) {
this.dateFormat = new AbsoluteTimeDateFormat(timeZone);
} else if(dateFormatType.equalsIgnoreCase(
AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT)) {
this.dateFormat = new DateTimeDateFormat(timeZone);
} else if(dateFormatType.equalsIgnoreCase(
AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT)) {
this.dateFormat = new ISO8601DateFormat(timeZone);
} else {
this.dateFormat = new SimpleDateFormat(dateFormatType);
this.dateFormat.setTimeZone(timeZone);
}
}
java类org.apache.log4j.helpers.ISO8601DateFormat的实例源码
DateLayout.java 文件源码
项目:cacheonix-core
阅读 20
收藏 0
点赞 0
评论 0
DateLayout.java 文件源码
项目:nabs
阅读 19
收藏 0
点赞 0
评论 0
/**
Sets the DateFormat used to format date and time in the time zone
determined by <code>timeZone</code> parameter. The {@link DateFormat} used
will depend on the <code>dateFormatType</code>.
<p>The recognized types are {@link #NULL_DATE_FORMAT}, {@link
#RELATIVE_TIME_DATE_FORMAT} {@link
AbsoluteTimeDateFormat#ABS_TIME_DATE_FORMAT}, {@link
AbsoluteTimeDateFormat#DATE_AND_TIME_DATE_FORMAT} and {@link
AbsoluteTimeDateFormat#ISO8601_DATE_FORMAT}. If the
<code>dateFormatType</code> is not one of the above, then the
argument is assumed to be a date pattern for {@link
SimpleDateFormat}.
*/
public
void setDateFormat(String dateFormatType, TimeZone timeZone) {
if(dateFormatType == null) {
this.dateFormat = null;
return;
}
if(dateFormatType.equalsIgnoreCase(NULL_DATE_FORMAT)) {
this.dateFormat = null;
} else if (dateFormatType.equalsIgnoreCase(RELATIVE_TIME_DATE_FORMAT)) {
this.dateFormat = new RelativeTimeDateFormat();
} else if(dateFormatType.equalsIgnoreCase(
AbsoluteTimeDateFormat.ABS_TIME_DATE_FORMAT)) {
this.dateFormat = new AbsoluteTimeDateFormat(timeZone);
} else if(dateFormatType.equalsIgnoreCase(
AbsoluteTimeDateFormat.DATE_AND_TIME_DATE_FORMAT)) {
this.dateFormat = new DateTimeDateFormat(timeZone);
} else if(dateFormatType.equalsIgnoreCase(
AbsoluteTimeDateFormat.ISO8601_DATE_FORMAT)) {
this.dateFormat = new ISO8601DateFormat(timeZone);
} else {
this.dateFormat = new SimpleDateFormat(dateFormatType);
this.dateFormat.setTimeZone(timeZone);
}
}
TxnLogProcessor.java 文件源码
项目:dble
阅读 19
收藏 0
点赞 0
评论 0
public TxnLogProcessor(BufferPool bufferPool) {
this.dateFormat = new ISO8601DateFormat();
this.queue = new LinkedBlockingQueue<>(256);
ServerConfig config = DbleServer.getInstance().getConfig();
SystemConfig systemConfig = config.getSystem();
this.store = new DailyRotateLogStore(systemConfig.getTransactionLogBaseDir(), systemConfig.getTransactionLogBaseName(), "log", systemConfig.getTransactionRatateSize());
}
Log4Json.java 文件源码
项目:hadoop-oss
阅读 20
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:hadoop
阅读 19
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:aliyun-oss-hadoop-fs
阅读 18
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:big-c
阅读 21
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:hadoop-2.6.0-cdh5.4.3
阅读 19
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:hadoop-plus
阅读 21
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:hops
阅读 21
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
DataSourceSillyProvider.java 文件源码
项目:smart-sync
阅读 21
收藏 0
点赞 0
评论 0
public DataSourceSillyProvider(String srcJdbc, String username, String pw, SmartSyncPump pump){
this.srcJdbc=srcJdbc; this.username=username; this.pw=pw;
dstJdbc=pump.jdbcString( "./dump_"+
ISO8601DateFormat.getDateInstance().format(new Date()));
}
Log4Json.java 文件源码
项目:hadoop-TCP
阅读 22
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:hardfs
阅读 17
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}
Log4Json.java 文件源码
项目:hadoop-on-lustre2
阅读 19
收藏 0
点赞 0
评论 0
public Log4Json() {
dateFormat = new ISO8601DateFormat();
}