org.metasyntactic.language.codes
Class ISO_8601

java.lang.Object
  |
  +--java.text.Format
        |
        +--java.text.DateFormat
              |
              +--java.text.SimpleDateFormat
                    |
                    +--org.metasyntactic.language.codes.ISO_8601
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class ISO_8601
extends java.text.SimpleDateFormat

The timestamp fields are based on a subset of ISO 8601. When being as precise as possible the format of a time string is yyyy-MM-ddTHH:mm:ss (year, "-", month, "-", day, "T", hour (out of 24), ":", minutes, ":", seconds), but the precision may be reduced by removing as many time indicators as wanted. Hence valid timestamps are yyyy, yyyy-MM, yyyy-MM-dd, yyyy-MM-ddTHH, yyyy-MM-ddTHH:mm and yyyy-MM-ddTHH:mm:ss. All time stamps are UTC. For durations, use the slash character as described in 8601, and for multiple non- contiguous dates, use multiple strings, if allowed by the frame definition.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.text.DateFormat
java.text.DateFormat.Field
 
Nested classes inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static java.lang.String DAY
           
static java.lang.String HOUR
           
static java.lang.String MINUTE
           
static java.lang.String MONTH
           
static java.lang.String SECOND
           
static java.lang.String YEAR
           
 
Fields inherited from class java.text.DateFormat
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
 
Constructor Summary
ISO_8601()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static java.util.Calendar toCalendar(java.lang.String str)
           
static java.lang.String toString(java.util.Date date)
           
static java.lang.String toString(java.util.Date date, java.lang.String format)
           
 
Methods inherited from class java.text.SimpleDateFormat
applyLocalizedPattern, applyPattern, clone, equals, format, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, parse, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern
 
Methods inherited from class java.text.DateFormat
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
 
Methods inherited from class java.text.Format
format, parseObject
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YEAR

public static final java.lang.String YEAR
See Also:
Constant Field Values

MONTH

public static final java.lang.String MONTH
See Also:
Constant Field Values

DAY

public static final java.lang.String DAY
See Also:
Constant Field Values

HOUR

public static final java.lang.String HOUR
See Also:
Constant Field Values

MINUTE

public static final java.lang.String MINUTE
See Also:
Constant Field Values

SECOND

public static final java.lang.String SECOND
See Also:
Constant Field Values
Constructor Detail

ISO_8601

public ISO_8601()
Method Detail

toString

public static java.lang.String toString(java.util.Date date)

toString

public static java.lang.String toString(java.util.Date date,
                                        java.lang.String format)

toCalendar

public static java.util.Calendar toCalendar(java.lang.String str)

main

public static void main(java.lang.String[] args)