public final class DateConverter
extends java.lang.Object
Modifier and Type | Method | Description |
---|---|---|
static java.util.Calendar |
toCalendar(java.lang.String text) |
Returns the Calendar for a given string containing a date,
or
null if it cannot be parsed. |
static java.util.Calendar |
toCalendar(COSString text) |
Returns the Calendar for a given COS string containing a date,
or
null if it cannot be parsed. |
static java.lang.String |
toISO8601(java.util.Calendar cal) |
Converts the date to ISO 8601 string format:
yyyy-mm-ddThh:MM:ss#hh:mm (where '#" is '+' or '-').
|
static java.lang.String |
toString(java.util.Calendar cal) |
Converts a Calendar to a string formatted as:
D:yyyyMMddHHmmss#hh'mm' where # is Z, +, or -.
|
public static java.lang.String toString(java.util.Calendar cal)
cal
- The date to convert to a string. May be null.
The DST_OFFSET is included when computing the output time zone.public static java.lang.String toISO8601(java.util.Calendar cal)
cal
- The date to convert. Must not be null.
The DST_OFFSET is included in the output value.public static java.util.Calendar toCalendar(COSString text)
null
if it cannot be parsed.
The returned value will have 0 for DST_OFFSET.text
- A COS string containing a date.null
if it cannot be parsed.public static java.util.Calendar toCalendar(java.lang.String text)
null
if it cannot be parsed.
The returned value will have 0 for DST_OFFSET.text
- A COS string containing a date.null
if it cannot be parsed.Copyright © 2002–2018. All rights reserved.