本文整理了Java中org.eigenbase.util14.ZonelessDate
类的一些代码示例,展示了ZonelessDate
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZonelessDate
类的具体详情如下:
包路径:org.eigenbase.util14.ZonelessDate
类名称:ZonelessDate
[英]ZonelessDate is a date value without a time zone.
[中]ZonelessDate是一个没有时区的日期值。
代码示例来源:origin: cascading/lingual-core
@Override
protected ZonelessDatetime createInstance()
{
return new ZonelessDate();
}
代码示例来源:origin: net.hydromatic/optiq
/**
* Parses a string as a ZonelessDate.
*
* @param s a string representing a date in ISO format, i.e. according to
* the SimpleDateFormat string "yyyy-MM-dd"
*
* @return the parsed date, or null if parsing failed
*/
public static ZonelessDate parse(String s)
{
return parse(s, DateTimeUtil.DateFormatStr);
}
代码示例来源:origin: org.apache.optiq/optiq-core
/**
* Formats this ZonelessDate via a SimpleDateFormat
*
* @param format format string, as required by {@link SimpleDateFormat}
* @return the formatted date string
*/
public String toString(String format) {
DateFormat formatter = getFormatter(format);
Date jdbcDate = getTempDate(getTime());
return formatter.format(jdbcDate);
}
代码示例来源:origin: net.hydromatic/optiq
/**
* Converts this ZonelessDate to a java.sql.Date and formats it via the
* {@link java.sql.Date#toString() toString()} method of that class.
*
* @return the formatted date string
*/
public String toString()
{
Date jdbcDate = getTempDate(getJdbcDate(DateTimeUtil.defaultZone));
return jdbcDate.toString();
}
代码示例来源:origin: net.hydromatic/optiq
/**
* Converts this literal to a {@link ZonelessDate} object.
*/
protected ZonelessDate getDate()
{
ZonelessDate zd = new ZonelessDate();
zd.setZonelessTime(getCal().getTimeInMillis());
return zd;
}
代码示例来源:origin: net.hydromatic/optiq
public void setZonelessTime(long value)
{
super.setZonelessTime(value);
clearTime();
}
代码示例来源:origin: org.apache.optiq/optiq-core
/**
* Returns e.g. '1969-07-21'.
*/
public String toFormattedString() {
return getDate().toString(formatString);
}
代码示例来源:origin: net.hydromatic/optiq
public Object toJdbcObject()
{
return new Date(getJdbcDate(DateTimeUtil.defaultZone));
}
代码示例来源:origin: org.apache.optiq/optiq-core
/**
* Converts this literal to a {@link ZonelessDate} object.
*/
protected ZonelessDate getDate() {
ZonelessDate zd = new ZonelessDate();
zd.setZonelessTime(getCal().getTimeInMillis());
return zd;
}
代码示例来源:origin: org.apache.optiq/optiq-core
/**
* Converts this ZonelessDate to a java.sql.Date and formats it via the
* {@link java.sql.Date#toString() toString()} method of that class.
*
* @return the formatted date string
*/
public String toString() {
Date jdbcDate = getTempDate(getJdbcDate(DateTimeUtil.DEFAULT_ZONE));
return jdbcDate.toString();
}
代码示例来源:origin: org.apache.optiq/optiq-core
public void setZonelessTime(long value) {
super.setZonelessTime(value);
clearTime();
}
代码示例来源:origin: net.hydromatic/optiq
/**
* Returns e.g. '1969-07-21'.
*/
public String toFormattedString()
{
return getDate().toString(formatString);
}
代码示例来源:origin: org.apache.optiq/optiq-core
public Object toJdbcObject() {
return new Date(getJdbcDate(DateTimeUtil.DEFAULT_ZONE));
}
代码示例来源:origin: org.apache.optiq/optiq-core
/**
* Parses a string as a ZonelessDate with a given format string.
*
* @param s a string representing a date in ISO format, i.e. according to
* the SimpleDateFormat string "yyyy-MM-dd"
* @param format format string as per {@link SimpleDateFormat}
* @return the parsed date, or null if parsing failed
*/
public static ZonelessDate parse(String s, String format) {
Calendar cal =
DateTimeUtil.parseDateFormat(
s,
format,
DateTimeUtil.GMT_ZONE);
if (cal == null) {
return null;
}
ZonelessDate zd = new ZonelessDate();
zd.setZonelessTime(cal.getTimeInMillis());
return zd;
}
代码示例来源:origin: net.hydromatic/optiq
/**
* Formats this ZonelessDate via a SimpleDateFormat
*
* @param format format string, as required by {@link SimpleDateFormat}
*
* @return the formatted date string
*/
public String toString(String format)
{
DateFormat formatter = getFormatter(format);
Date jdbcDate = getTempDate(getTime());
return formatter.format(jdbcDate);
}
代码示例来源:origin: org.apache.optiq/optiq-core
/**
* Parses a string as a ZonelessDate.
*
* @param s a string representing a date in ISO format, i.e. according to
* the SimpleDateFormat string "yyyy-MM-dd"
* @return the parsed date, or null if parsing failed
*/
public static ZonelessDate parse(String s) {
return parse(s, DateTimeUtil.DATE_FORMAT_STRING);
}
代码示例来源:origin: org.apache.optiq/optiq-core
break;
case DATE:
printDatetime(pw, new ZonelessDate(), value);
break;
case TIME:
代码示例来源:origin: net.hydromatic/optiq
public void setZonedTime(long value, TimeZone zone)
{
super.setZonedTime(value, zone);
clearTime();
}
代码示例来源:origin: net.hydromatic/optiq
/**
* Parses a string as a ZonelessDate with a given format string.
*
* @param s a string representing a date in ISO format, i.e. according to
* the SimpleDateFormat string "yyyy-MM-dd"
* @param format format string as per {@link SimpleDateFormat}
*
* @return the parsed date, or null if parsing failed
*/
public static ZonelessDate parse(String s, String format)
{
Calendar cal =
DateTimeUtil.parseDateFormat(
s,
format,
DateTimeUtil.gmtZone);
if (cal == null) {
return null;
}
ZonelessDate zd = new ZonelessDate();
zd.setZonelessTime(cal.getTimeInMillis());
return zd;
}
代码示例来源:origin: cascading/lingual-core
protected ZonelessDatetime parse( String value )
{
return ZonelessDate.parse( value );
}
内容来源于网络,如有侵权,请联系作者删除!