List of usage examples for javax.xml.datatype XMLGregorianCalendar getFractionalSecond
public abstract BigDecimal getFractionalSecond();
From source file:Main.java
public static BigDecimal getSeconds(XMLGregorianCalendar x) { BigDecimal fractional = x.getFractionalSecond(); if (fractional == null) fractional = BigDecimal.ZERO; BigDecimal whole = BigDecimal.valueOf(x.getSecond()); return whole.add(fractional); }
From source file:org.jasig.portlet.calendar.adapter.ExchangeCalendarAdapterTest.java
@Test public void testGetXmlDate() throws DatatypeConfigurationException { // construct a calendar representing 4:30PM on June 4, 2010 DateTime date = new DateTime(2010, 6, 3, 16, 30, DateTimeZone.UTC); XMLGregorianCalendar xmlCal = adapter.getXmlDate(date); assertEquals(2010, xmlCal.getYear()); assertEquals(6, xmlCal.getMonth());/*w ww . jav a 2 s .c o m*/ assertEquals(3, xmlCal.getDay()); assertEquals(16, xmlCal.getHour()); assertEquals(30, xmlCal.getMinute()); assertEquals(0, xmlCal.getSecond()); assertEquals(0, xmlCal.getFractionalSecond().intValue()); }