当前位置: 首页>>代码示例>>Java>>正文


Java ISO8601DateFormat类代码示例

本文整理汇总了Java中org.apache.log4j.helpers.ISO8601DateFormat的典型用法代码示例。如果您正苦于以下问题:Java ISO8601DateFormat类的具体用法?Java ISO8601DateFormat怎么用?Java ISO8601DateFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ISO8601DateFormat类属于org.apache.log4j.helpers包,在下文中一共展示了ISO8601DateFormat类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDateFormat

import org.apache.log4j.helpers.ISO8601DateFormat; //导入依赖的package包/类
/**
   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);
  }
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:40,代码来源:DateLayout.java

示例2: TxnLogProcessor

import org.apache.log4j.helpers.ISO8601DateFormat; //导入依赖的package包/类
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());
}
 
开发者ID:actiontech,项目名称:dble,代码行数:8,代码来源:TxnLogProcessor.java

示例3: Log4Json

import org.apache.log4j.helpers.ISO8601DateFormat; //导入依赖的package包/类
public Log4Json() {
  dateFormat = new ISO8601DateFormat();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:4,代码来源:Log4Json.java

示例4: DataSourceSillyProvider

import org.apache.log4j.helpers.ISO8601DateFormat; //导入依赖的package包/类
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()));
}
 
开发者ID:daitangio,项目名称:smart-sync,代码行数:6,代码来源:DataSourceSillyProvider.java


注:本文中的org.apache.log4j.helpers.ISO8601DateFormat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。