net.sf.seaf.util.convert.simple
Class ConverterToTimestamp
java.lang.Object
net.sf.seaf.util.convert.simple.ConverterToTimestamp
public class ConverterToTimestamp
- extends Object
Converter of any Object to a timestamp represented by Calendar.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FORMAT_ISO
public static final String FORMAT_ISO
- See Also:
- Constant Field Values
ConverterToTimestamp
public ConverterToTimestamp()
convert
public static Calendar convert(Object o)
throws IllegalArgumentException
- Converts an Object to Calendar timestamp value.
Keeps null as null. Converts java.util.Date. Keeps Calendar. Otherwise
converts via String expecting ISO timestamp format
(yyyy-MM-dd'T'HH:mm:ss.SSSZ).
- Parameters:
o - Object to be converted
- Returns:
- Calendar
- Throws:
IllegalArgumentException - Thrown when the argument is not a valid Timestamp
Copyright © 2008-2012 SEAF. All Rights Reserved.