public class DateConvert extends Object
Constructor and Description |
---|
DateConvert() |
Modifier and Type | Method and Description |
---|---|
static XMLGregorianCalendar |
convertDate(Date date)
Converts a java.util.Date to a javax.xml.datatype.XMLGregorianCalendar.
|
static Date |
convertXMLCal(XMLGregorianCalendar xgc)
Converts the given XMLGregorianCalendar to a java.util.Date.
|
static XMLGregorianCalendar |
getBeginning(XMLGregorianCalendar time,
String hourlyDailyChoice)
Returns the beginning of the hour or day given the time and hour or daily choice.
|
static XMLGregorianCalendar |
getEnding(XMLGregorianCalendar time,
String hourlyDailyChoice)
Returns the end of the hour or day give the time and the hour or daily choice.
|
static XMLGregorianCalendar |
parseCalString(String s)
Parses the given String representation of an XMLGregorianCalendar and
returns the instance.
|
static Date |
parseCalStringToDate(String s) |
public static XMLGregorianCalendar parseCalString(String s) throws ParseException, DatatypeConfigurationException
s
- The String representation of an XMLGregorianCalendar with the
format yyyy-MM-dd'T'HH:mm:ss.SSSParseException
- if the string has the wrong format.DatatypeConfigurationException
- if there is a problems instantiating the DatatypeFactory.public static Date parseCalStringToDate(String s) throws ParseException, DatatypeConfigurationException
s
- The String representation in the format yyyy-MM-dd'T'HH:mm:ss.SSS.ParseException
- if the string has the wrong format.DatatypeConfigurationException
- if there is a problem initializing the DatatypeFactory.public static XMLGregorianCalendar convertDate(Date date) throws DatatypeConfigurationException
date
- The Date to convert.DatatypeConfigurationException
- if there is a problem instantiating the DatatypeFactory.public static Date convertXMLCal(XMLGregorianCalendar xgc)
xgc
- The XMLGregorianCalendar.public static XMLGregorianCalendar getBeginning(XMLGregorianCalendar time, String hourlyDailyChoice)
time
- the current time.hourlyDailyChoice
- how wide the window should be.public static XMLGregorianCalendar getEnding(XMLGregorianCalendar time, String hourlyDailyChoice)
time
- the current time.hourlyDailyChoice
- the width of the window.Copyright © 2015 Collaborative Software Development Laboratory. All rights reserved.