本文整理了Java中org.apache.xmlbeans.XmlCalendar.set()
方法的一些代码示例,展示了XmlCalendar.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlCalendar.set()
方法的具体详情如下:
包路径:org.apache.xmlbeans.XmlCalendar
类名称:XmlCalendar
方法名:set
[英]Sets the default year to be used when no year is specified.
[中]设置未指定年份时要使用的默认年份。
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
if (y > 0)
set(Calendar.ERA, GregorianCalendar.AD);
set(Calendar.ERA, GregorianCalendar.BC);
set(Calendar.YEAR, y);
set(Calendar.MONTH, date.getMonth() - 1); // note!!
if (date.hasDay())
set(Calendar.DAY_OF_MONTH, date.getDay());
if (date.hasTime())
set(Calendar.HOUR_OF_DAY, date.getHour());
set(Calendar.MINUTE, date.getMinute());
set(Calendar.SECOND, date.getSecond());
if (date.getFraction().scale() > 0)
set(Calendar.MILLISECOND, date.getMillisecond());
set(Calendar.ZONE_OFFSET, date.getTimeZoneSign() * 1000 * 60 * (date.getTimeZoneHour() * 60 + date.getTimeZoneMinute()));
set(Calendar.DST_OFFSET, 0); // note!! if we don't do this, then GregorianCalendar will pick up DST from the time zone
代码示例来源:origin: org.apache.xmlbeans/xmlbeans
/**
* Overrides GregorianCalendar.computeTime to apply a different
* default year. (It must be a leap year.)
*/
protected void computeTime()
{
boolean unsetYear = !isSet(YEAR);
if (unsetYear)
set(YEAR, getDefaultYear());
try
{
super.computeTime();
}
finally
{
if (unsetYear)
clear(YEAR);
}
}
代码示例来源:origin: org.apache.xmlbeans/com.springsource.org.apache.xmlbeans
if (y > 0)
set(Calendar.ERA, GregorianCalendar.AD);
set(Calendar.ERA, GregorianCalendar.BC);
set(Calendar.YEAR, y);
set(Calendar.MONTH, date.getMonth() - 1); // note!!
if (date.hasDay())
set(Calendar.DAY_OF_MONTH, date.getDay());
if (date.hasTime())
set(Calendar.HOUR_OF_DAY, date.getHour());
set(Calendar.MINUTE, date.getMinute());
set(Calendar.SECOND, date.getSecond());
if (date.getFraction().scale() > 0)
set(Calendar.MILLISECOND, date.getMillisecond());
set(Calendar.ZONE_OFFSET, date.getTimeZoneSign() * 1000 * 60 * (date.getTimeZoneHour() * 60 + date.getTimeZoneMinute()));
set(Calendar.DST_OFFSET, 0); // note!! if we don't do this, then GregorianCalendar will pick up DST from the time zone
代码示例来源:origin: org.apache.xmlbeans/com.springsource.org.apache.xmlbeans
/**
* Overrides GregorianCalendar.computeTime to apply a different
* default year. (It must be a leap year.)
*/
protected void computeTime()
{
boolean unsetYear = !isSet(YEAR);
if (unsetYear)
set(YEAR, getDefaultYear());
try
{
super.computeTime();
}
finally
{
if (unsetYear)
clear(YEAR);
}
}
代码示例来源:origin: com.github.pjfanning/xmlbeans
if (y > 0)
set(Calendar.ERA, GregorianCalendar.AD);
set(Calendar.ERA, GregorianCalendar.BC);
set(Calendar.YEAR, y);
set(Calendar.MONTH, date.getMonth() - 1); // note!!
if (date.hasDay())
set(Calendar.DAY_OF_MONTH, date.getDay());
if (date.hasTime())
set(Calendar.HOUR_OF_DAY, date.getHour());
set(Calendar.MINUTE, date.getMinute());
set(Calendar.SECOND, date.getSecond());
if (date.getFraction().scale() > 0)
set(Calendar.MILLISECOND, date.getMillisecond());
set(Calendar.ZONE_OFFSET, date.getTimeZoneSign() * 1000 * 60 * (date.getTimeZoneHour() * 60 + date.getTimeZoneMinute()));
set(Calendar.DST_OFFSET, 0); // note!! if we don't do this, then GregorianCalendar will pick up DST from the time zone
代码示例来源:origin: com.github.pjfanning/xmlbeans
/**
* Overrides GregorianCalendar.computeTime to apply a different
* default year. (It must be a leap year.)
*/
protected void computeTime()
{
boolean unsetYear = !isSet(YEAR);
if (unsetYear)
set(YEAR, getDefaultYear());
try
{
super.computeTime();
}
finally
{
if (unsetYear)
clear(YEAR);
}
}
内容来源于网络,如有侵权,请联系作者删除!