Package net.sbbi.upnp.services
Class ISO8601Date
- java.lang.Object
-
- net.sbbi.upnp.services.ISO8601Date
-
public class ISO8601Date extends java.lang.Object
ISO8601 Date implementation taken from org.w3c package and modified to work with UPNP date types
-
-
Constructor Summary
Constructors Constructor Description ISO8601Date()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getIsoDate(java.util.Date date)
Generate a ISO 8601 datestatic java.lang.String
getIsoDateTime(java.util.Date date)
Generate a ISO 8601 date time without timezonestatic java.lang.String
getIsoDateTimeZone(java.util.Date date)
Generate a ISO 8601 date time with timezonestatic java.lang.String
getIsoTime(java.util.Date date)
Generate a ISO 8601 timestatic java.lang.String
getIsoTimeZone(java.util.Date date)
Generate a ISO 8601 timestatic java.util.Date
parse(java.lang.String isodate)
Parse the given string in ISO 8601 format and build a Date object.
-
-
-
Method Detail
-
parse
public static java.util.Date parse(java.lang.String isodate) throws java.lang.NumberFormatException
Parse the given string in ISO 8601 format and build a Date object.- Parameters:
isodate
- the date in ISO 8601 format- Returns:
- a Date instance
- Throws:
java.lang.NumberFormatException
- if the date is not valid
-
getIsoDate
public static java.lang.String getIsoDate(java.util.Date date)
Generate a ISO 8601 date- Parameters:
date
- a Date instance- Returns:
- a string representing the date in the ISO 8601 format
-
getIsoDateTime
public static java.lang.String getIsoDateTime(java.util.Date date)
Generate a ISO 8601 date time without timezone- Parameters:
date
- a Date instance- Returns:
- a string representing the date in the ISO 8601 format
-
getIsoDateTimeZone
public static java.lang.String getIsoDateTimeZone(java.util.Date date)
Generate a ISO 8601 date time with timezone- Parameters:
date
- a Date instance- Returns:
- a string representing the date in the ISO 8601 format
-
getIsoTime
public static java.lang.String getIsoTime(java.util.Date date)
Generate a ISO 8601 time- Parameters:
date
- a Date instance- Returns:
- a string representing the date in the ISO 8601 format
-
getIsoTimeZone
public static java.lang.String getIsoTimeZone(java.util.Date date)
Generate a ISO 8601 time- Parameters:
date
- a Date instance- Returns:
- a string representing the date in the ISO 8601 format
-
-