|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecebs.rtd.enabler.common.CalendarUtils
public class CalendarUtils
Provides methods to aide in creating and parsing dates obtained from RTD. Also helps in parsing dates from IPE data.
Method Summary | |
---|---|
static Calendar |
byteArrayToDTS(byte[] sourceArray,
int sourceIndex)
Parses 3 bytes from the sourceArray , starting at the sourceIndex ,
and uses that to create an ITSO DTS |
static Calendar |
createITSOBaseDate()
Create a new instance of a calendar set to the ITSO base date |
static Calendar |
createITSODate(int days)
Creates an ITSO date instance set to the specified number of days since the ITSO base date (01/01/1997) |
static String |
getFormattedDate(Calendar calendar,
String format)
Create a string representation of a date and time in the format specified |
static String |
getRTDSFormattedDate(Calendar calendar)
Create a string representation of a date in the format required by RTD |
static String |
getRTDSFormattedDateWithTime(Calendar calendar)
Create a string representation of a date and time in the format required by RTD |
static boolean |
isITSOBaseDate(Calendar dts)
Check if a calendar instance is set to the ITSO base date |
static Calendar |
parseRTDDate(String dts)
Creates a calendar instance from the provided string. |
static Calendar |
parseRTDDateWithTime(String dts)
Creates a calendar instance from the provided string. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String getRTDSFormattedDate(Calendar calendar)
calendar
- Instance to be converted
public static String getRTDSFormattedDateWithTime(Calendar calendar)
calendar
- Instance to be converted
public static String getFormattedDate(Calendar calendar, String format)
calendar
- Instance to be convertedformat
- Format of the string to be returned, in Formatter
date/time format syntax
public static Calendar createITSOBaseDate()
public static boolean isITSOBaseDate(Calendar dts)
dts
- Instance to check
public static Calendar parseRTDDateWithTime(String dts) throws ParseException
dts
- String to parse
ParseException
- Thrown if the string was not in the required formatpublic static Calendar parseRTDDate(String dts) throws ParseException
dts
- String to parse
ParseException
- Thrown if the string was not in the required formatpublic static Calendar byteArrayToDTS(byte[] sourceArray, int sourceIndex)
sourceArray
, starting at the sourceIndex
,
and uses that to create an ITSO DTS
sourceArray
- Array to read bytes fromsourceIndex
- Position to start reading
public static Calendar createITSODate(int days)
days
- Number of days to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |