net.charlesames.utility.date
Class ISO8601

java.lang.Object
  extended by net.charlesames.utility.date.ISO8601

public abstract class ISO8601
extends java.lang.Object

Methods supporting the ISO-8601 date format.

The code source is http://www.java2s.com/Code/Java/Data-Type/ISO8601dateparsingutility.htm

Author:
Unknown

Constructor Summary
ISO8601()
           
 
Method Summary
static java.lang.String formatAsDateTime(java.util.Date date)
          Converts a date to ISO-8601 format.
static java.util.Date parseDateTime(java.lang.String input)
          Parses a date from ISO-8601 format.
static java.util.Date parseDuration(java.lang.String text)
          Converts an ISO8601 duration to a date.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISO8601

public ISO8601()
Method Detail

parseDuration

public static java.util.Date parseDuration(java.lang.String text)
                                    throws java.text.ParseException
Converts an ISO8601 duration to a date.

Parameters:
text - Text representing a date in ISO-8601 format.
Returns:
The decoded date.
Throws:
java.text.ParseException

parseDateTime

public static java.util.Date parseDateTime(java.lang.String input)
                                    throws java.text.ParseException
Parses a date from ISO-8601 format.

Parameters:
input - The formatted text.
Returns:
The data.
Throws:
java.text.ParseException

formatAsDateTime

public static java.lang.String formatAsDateTime(java.util.Date date)
Converts a date to ISO-8601 format.

Parameters:
date - The date.
Returns:
The formatted text.