44,7 → 44,7 |
|
private static String ERR_INVALIDFORMAT = "Invalid format pattern."; |
private static String ERR_INVALIDTIMEZONE = "Invalid timezone."; |
@Override |
|
public GregorianCalendar getDate(String timezone) throws XServicesFault { |
if (! isValidTimezone(timezone) ) { |
String valid_ids = ""; |
60,7 → 60,7 |
return c; |
} |
|
@Override |
|
public BigInteger getTimestamp() { |
Date d = new Date(); |
long l = d.getTime(); |
68,7 → 68,7 |
return timestamp; |
} |
|
@Override |
|
public GregorianCalendar getInTimezone(GregorianCalendar cal, |
String timezone) throws XServicesFault { |
if(! isValidTimezone(timezone)) throw new XServicesFault(ERR_INVALIDTIMEZONE); |
77,12 → 77,12 |
return c; |
} |
|
@Override |
|
public String formatDate(GregorianCalendar cal, DateFormatType format) throws XServicesFault { |
return formatDateAdvanced(cal, format.format()); |
} |
|
@Override |
|
public String formatDateAdvanced(GregorianCalendar cal, String format) |
throws XServicesFault { |
String result= null; |
95,12 → 95,12 |
return result; |
} |
|
@Override |
|
public GregorianCalendar parseDate(String s, DateFormatType format, String timezone) throws XServicesFault { |
return parseDateAdvanced(s, format.format(), timezone); |
} |
|
@Override |
|
public GregorianCalendar parseDateAdvanced(String s, String format, String timezone) throws XServicesFault { |
SimpleDateFormat f = null; |
Date date = null; |
121,7 → 121,7 |
return cal; |
} |
|
@Override |
|
public BigInteger dateTimeDiff(GregorianCalendar fromCal, |
GregorianCalendar toCal) throws XServicesFault { |
long diff = toCal.getTimeInMillis() - fromCal.getTimeInMillis(); |
129,7 → 129,7 |
return d; |
} |
|
@Override |
|
public BigInteger dateTimeDiff2(GregorianCalendar fromCal, |
GregorianCalendar toCal, DateTimeUnits unit) throws XServicesFault { |
BigInteger d = dateTimeDiff(fromCal, toCal); |
149,7 → 149,7 |
return d; |
} |
|
@Override |
|
public GregorianCalendar dateAdd(GregorianCalendar cal, BigInteger value, DateTimeUnits unit) |
throws XServicesFault { |
switch (unit) { |