Joda System API

org.joda.property.type
Interface DateTimeProperty

All Superinterfaces:
java.lang.Comparable, DataProperty, DateProperty, InstantProperty, ModelElement, Property, org.joda.time.ReadableInstant, org.joda.time.ReadWritableInstant, java.io.Serializable, TimeProperty
All Known Implementing Classes:
DefaultDateTimeProperty

public interface DateTimeProperty
extends DateProperty, TimeProperty, org.joda.time.ReadWritableInstant

Interface for DateTime properties, based on ISO8601 date/time definitions. The methods on DateTimeProperty represent the 'normal' date concepts used by most Loclaes - Gregorian. The decision to merge the functionality of the Java Date, Calendar and GregorianCalendar classes was taken to provide a more obvious interface. The specific get methods return values in the ranges from the ISO standard, thus months are 1 based. Constructors should respect this convention. It is expected that implementations cannot hold invalid datetimes, thus exceptions should be thrown by constructors and set methods.

Calendar does not describe a standard String format. However such a format is required for various property methods. The String format must completely encapsulate the property's value and be portable so far as possible between two completely different implementations. To achieve this the basic String format is ISO8601.

Output Dates

The format is YYYY-MM-DDThh:mm:ss.sss. For example, for 31st January 2002:
2002-01-31T00:00:00.000

Input - Dates

Various formats are accepted. For example, considering 31st January 2002:
2002-01-31 or 20020131 (full representation)
2002-01 or 200201 (month only)
2002 or 2002 (year only)
20 (century only)
2002-W05 or 2002W05 (week only)
2002-W05-4 or 2002W054 (full representation as fourth day in fifth week)
2002-031 or 2002031 (full representation as 31st day in year)

Input - Times

Various formats are accepted. For example, considering 4:30 pm, 26.4 seconds:
T16:30:26.400 (full representation)
T1630264 (full representation, compact)
T16:30:26 or T163026 (hour/minute/second only)
T16:30 or T1630 (hour/minute only)
T16 (hour only)

DateTime

The format is the Date part followed by a 'T' then the time part.

Week 1 is the week that the 4th January is in, as this means it is mostly in that year. Note weeks can range from 01-53 and can include days in another year.
Weekdays are Monday(1) to Sunday(7).
Days in year are from 001 to 366.
Midnight should be represented as 00:00, but 24:00 is accepted.
A dash may be used to represent missing portions of the string. One dash is used to represent the part missing even if it is more than one character normally.
To indicate time BC, prefix by BC. If you explicitly want to represent AD, then use CD as the prefix. (from ANSI X3.30).
The letters (T/Z/W/BC/CD) may be lower case.

Author:
Stephen Colebourne

Nested Class Summary
 
Nested classes inherited from class org.joda.property.Property
Property.Internal
 
Field Summary
static java.lang.Class DEFAULT_TYPE
           
 
Methods inherited from interface org.joda.property.type.InstantProperty
get, toCalendar, toDate, toGregorianCalendar
 
Methods inherited from interface org.joda.property.type.DataProperty
toDataString
 
Methods inherited from interface org.joda.property.Property
addPropertyChangeListener, bean, equals, equalsValue, firePropertyChange, getContentName, getContentType, getPropertyName, getPropertyType, hashCode, isModifiable, isNull, isReadOnly, removePropertyChangeListener, set, setModifiable, setReadOnly, toObject, toString
 
Methods inherited from interface org.joda.property.ModelElement
getAttribute, getAttributeCount, getAttributeMap, setAttribute
 
Methods inherited from interface org.joda.time.ReadWritableInstant
add, add, addMillis, addWrapped, set, setMillis, setMillis
 
Methods inherited from interface org.joda.time.ReadableInstant
compareTo, equals, get, getChronology, getDateTimeZone, getMillis, hashCode, isAfter, isBefore, isEqual, toCopy, toCopy, toInstant, toString
 

Field Detail

DEFAULT_TYPE

public static final java.lang.Class DEFAULT_TYPE

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.