org.geotools.feature.type.DateUtil.serializeSqlTime()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.geotools.feature.type.DateUtil.serializeSqlTime()方法的一些代码示例,展示了DateUtil.serializeSqlTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateUtil.serializeSqlTime()方法的具体详情如下:
包路径:org.geotools.feature.type.DateUtil
类名称:DateUtil
方法名:serializeSqlTime

DateUtil.serializeSqlTime介绍

[英]Serialize time to standard text. Time values are formatted in W3C XML Schema standard format as hh:mm:ss, with optional trailing seconds decimal, as necessary. The standard conversion does not append a time zone indication.
[中]将时间序列化为标准文本。时间值以W3CXMLSchema标准格式格式化为hh:mm:ss,并根据需要使用可选的尾随秒十进制。标准转换不附加时区指示。

代码示例

代码示例来源:origin: geotools/geotools

public void testSqlTime() {
    Calendar cal = Calendar.getInstance();
    cal.clear();
    cal.set(2007, 3, 1, 1, 15);

    long lngTime = cal.getTime().getTime();
    java.sql.Time time = new java.sql.Time(lngTime);
    // System.out.println(time);
    String t = DateUtil.serializeSqlTime(time);
    // System.out.println(t);
    assertEquals("01:15:00", t);
  }
}

代码示例来源:origin: geotools/geotools

text = DateUtil.serializeSqlDate((java.sql.Date) value);
else if (value instanceof java.sql.Time)
  text = DateUtil.serializeSqlTime((java.sql.Time) value);
else text = DateUtil.serializeDateTime((Date) value);
contentHandler.characters(text.toCharArray(), 0, text.length());

代码示例来源:origin: org.geoserver/gs-wfs

@Override
  public String format(Object att) {
    return prepCSVField(DateUtil.serializeSqlTime((java.sql.Time) att));
  }
}

代码示例来源:origin: org.geoserver/gs-wfs

private String formatToString(Object att, NumberFormat coordFormatter) {
  String value;
  if (att instanceof Number) {
    // don't allow scientific notation in the output, as OpenOffice won't
    // recognize that as a number
    value = coordFormatter.format(att);
  } else if (att instanceof Date) {
    // serialize dates in ISO format
    if (att instanceof java.sql.Date)
      value = DateUtil.serializeSqlDate((java.sql.Date) att);
    else if (att instanceof java.sql.Time)
      value = DateUtil.serializeSqlTime((java.sql.Time) att);
    else value = DateUtil.serializeDateTime((Date) att);
  } else {
    // everything else we just "toString"
    value = att.toString();
  }
  return value;
}

代码示例来源:origin: org.geotools/gt2-main

text = DateUtil.serializeSqlDate((java.sql.Date) value);
else if(value instanceof java.sql.Time)
  text = DateUtil.serializeSqlTime((java.sql.Time) value);
else
  text = DateUtil.serializeDateTime((Date) value);

代码示例来源:origin: org.geotools/gt-main

text = DateUtil.serializeSqlDate((java.sql.Date) value);
else if(value instanceof java.sql.Time)
  text = DateUtil.serializeSqlTime((java.sql.Time) value);
else
  text = DateUtil.serializeDateTime((Date) value);

相关文章