|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectezvcard.util.VCardDateFormatter
public class VCardDateFormatter
Helper class that formats and parses vCard dates. vCard dates adhere to the ISO8601 date format standard.
Method Summary | |
---|---|
static String |
format(Date date,
ISOFormat format)
Formats a date for inclusion in a vCard. |
static String |
format(Date date,
ISOFormat format,
TimeZone timeZone)
Formats a date for inclusion in a vCard. |
static String |
formatTimeZone(int hourOffset,
int minuteOffset,
boolean extended)
Formats a timezone offset according to ISO8601 rules. |
static String |
formatTimeZone(TimeZone timeZone,
boolean extended)
Formats a TimeZone object according to ISO8601 rules. |
static Date |
parse(String dateStr)
Parses a vCard date. |
static int[] |
parseTimeZone(String offsetStr)
Parses a timezone that's in ISO8601 format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String format(Date date, ISOFormat format)
date
- the date to formatformat
- the format to use
public static String format(Date date, ISOFormat format, TimeZone timeZone)
date
- the date to formatformat
- the format to usetimeZone
- the time zone to format the date in. This will be ignored
if the specified ISOFormat is a "UTC" format
public static Date parse(String dateStr)
dateStr
- the date string to parse
IllegalArgumentException
- if the date string isn't in one of the
accepted ISO8601 formatspublic static int[] parseTimeZone(String offsetStr)
offsetStr
- the timezone offset string (e.g. "-0500" or "-05:00")
IllegalArgumentException
- if the timezone string isn't in the
right formatpublic static String formatTimeZone(TimeZone timeZone, boolean extended)
TimeZone
object according to ISO8601 rules.
timeZone
- the timezone to formatextended
- true to use "extended" format, false not to. Extended
format will put a colon between the hour and minute.
public static String formatTimeZone(int hourOffset, int minuteOffset, boolean extended)
hourOffset
- the hour offsetminuteOffset
- the minute offset (must be between 0 and 59)extended
- true to use "extended" format, false not to. Extended
format will put a colon between the hour and minute.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |