本文整理了Java中org.geotools.feature.type.DateUtil.serializeDate()
方法的一些代码示例,展示了DateUtil.serializeDate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateUtil.serializeDate()
方法的具体详情如下:
包路径:org.geotools.feature.type.DateUtil
类名称:DateUtil
方法名:serializeDate
[英]Serialize time to general date text. Date values are formatted in W3C XML Schema standard format as CCYY-MM-DD, with optional leading sign included if necessary.
[中]将时间序列化为常规日期文本。日期值的格式为W3C XML模式标准格式CCYY-MM-DD,必要时包括可选的前导符号。
代码示例来源:origin: geotools/geotools
/**
* Serialize SQL date to general date text. Date values are formatted in W3C XML Schema standard
* format as CCYY-MM-DD, with optional leading sign included if necessary.
*
* @param date date to be converted
* @return converted date text
* @throws IllegalArgumentException on conversion error
*/
public static String serializeSqlDate(java.sql.Date date) throws IllegalArgumentException {
return serializeDate(date);
}
代码示例来源:origin: geotools/geotools
public void testJavaUtilDate() {
Calendar cal = Calendar.getInstance();
cal.clear();
cal.set(2007, 3, 1, 1, 15);
Date time = cal.getTime();
String dateTime = DateUtil.serializeDateTime(time);
assertEquals("2007-04-01T01:15:00", dateTime);
String date = DateUtil.serializeDate(time);
assertEquals("2007-04-01", date);
}
代码示例来源:origin: geotools/geotools
/**
* Serialize date to general date text. Date values are formatted in W3C XML Schema standard
* format as CCYY-MM-DD, with optional leading sign included if necessary.
*
* @param date date to be converted
* @return converted date text
* @throws IllegalArgumentException on conversion error
*/
public static String serializeDate(Date date) throws IllegalArgumentException {
long time = date.getTime();
time += TimeZone.getDefault().getOffset(time);
return serializeDate(time);
}
代码示例来源:origin: org.geotools/gt-main
/**
* Serialize SQL date to general date text. Date values are formatted in
* W3C XML Schema standard format as CCYY-MM-DD, with optional leading
* sign included if necessary.
*
* @param date date to be converted
*
* @return converted date text
*
* @throws IllegalArgumentException on conversion error
*/
public static String serializeSqlDate(java.sql.Date date)
throws IllegalArgumentException {
return serializeDate(date);
}
代码示例来源:origin: org.geotools/gt2-main
/**
* Serialize SQL date to general date text. Date values are formatted in
* W3C XML Schema standard format as CCYY-MM-DD, with optional leading
* sign included if necessary.
*
* @param date date to be converted
*
* @return converted date text
*
* @throws IllegalArgumentException on conversion error
*/
public static String serializeSqlDate(java.sql.Date date)
throws IllegalArgumentException {
return serializeDate(date);
}
代码示例来源:origin: org.geotools/gt-main
/**
* Serialize date to general date text. Date values are formatted in W3C
* XML Schema standard format as CCYY-MM-DD, with optional leading sign
* included if necessary.
*
* @param date date to be converted
*
* @return converted date text
*
* @throws IllegalArgumentException on conversion error
*/
public static String serializeDate(Date date)
throws IllegalArgumentException {
long time = date.getTime();
time += TimeZone.getDefault().getOffset(time);
return serializeDate(time);
}
代码示例来源:origin: org.geotools/gt2-main
/**
* Serialize date to general date text. Date values are formatted in W3C
* XML Schema standard format as CCYY-MM-DD, with optional leading sign
* included if necessary.
*
* @param date date to be converted
*
* @return converted date text
*
* @throws IllegalArgumentException on conversion error
*/
public static String serializeDate(Date date)
throws IllegalArgumentException {
long time = date.getTime();
time += TimeZone.getDefault().getOffset(time);
return serializeDate(time);
}
内容来源于网络,如有侵权,请联系作者删除!