net.tomp2p.upnp
Class ISO8601Date

java.lang.Object
  extended by net.tomp2p.upnp.ISO8601Date

public class ISO8601Date
extends Object

ISO8601 Date implementation taken from org.w3c package and modified to work with UPNP date types

Version:
1.0
Author:
SuperBonBon

Constructor Summary
ISO8601Date()
           
 
Method Summary
static String getIsoDate(Date date)
          Generate a ISO 8601 date
static String getIsoDateTime(Date date)
          Generate a ISO 8601 date time without timezone
static String getIsoDateTimeZone(Date date)
          Generate a ISO 8601 date time with timezone
static String getIsoTime(Date date)
          Generate a ISO 8601 time
static String getIsoTimeZone(Date date)
          Generate a ISO 8601 time
static Date parse(String isodate)
          Parse the given string in ISO 8601 format and build a Date object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISO8601Date

public ISO8601Date()
Method Detail

parse

public static Date parse(String isodate)
                  throws 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:
NumberFormatException - if the date is not valid

getIsoDate

public static String getIsoDate(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 String getIsoDateTime(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 String getIsoDateTimeZone(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 String getIsoTime(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 String getIsoTimeZone(Date date)
Generate a ISO 8601 time

Parameters:
date - a Date instance
Returns:
a string representing the date in the ISO 8601 format


Copyright © 2013. All Rights Reserved.