Data Format Description Language (DFDL) v1.0 Specification
OGF Proposed Recommendation GFD-P-R.174, January 31, 2011
The properties describe how a calendar is to be interpreted including a formatting pattern property plus properties that qualify the pattern.
These properties can be used when a calendar has a representation of ‘text’ or a representation of ‘binary' and a dfdl:binaryCalendarRep of ‘packed’ or ‘bcd’.
Property Name |
Description |
||||||||
---|---|---|---|---|---|---|---|---|---|
calendarPattern |
String Defines the ICU pattern that describes the format of the calendar. The pattern defines where the year, month, day, hour, minute, second, fractional second and time zone components appear. See calendarPattern property section below. When the dfdl:representation is 'binary' and dfdl:binaryCalendarRep is 'packed' or 'bcd' then the pattern can contain only characters that result in a presentation of number. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarPatternKind |
Enum Valid values ‘explicit’, ‘implicit’ ‘explicit’ means the pattern is given by dfdl:calendarPattern, ‘implicit’ means the pattern is derived from the XML schema date/time type.
Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarCheckPolicy |
Enum Valid values are 'strict', 'lax' Indicates how lenient to be when parsing against the pattern. If 'lax' then the parser will convert invalid date/time values to the appropriate in-band value. For example, a date of 2005-05-32 will be converted to 2005-06-01. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarTimeZone |
Enum Valid values are the list of time zone designations in the form UTC±n where n is the offset in hours. The offset can be expressed as the hours or hours and minutes. Examples UTC-1, UTC+4:30, The time zone that will be assumed if no time zone explicitly occurs in the data. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarObserveDST |
Enum Valid values are 'yes', 'no' Whether the time zone given in dfdl:calendarTimeZone observes daylight savings time. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarFirstDayOfWeek |
Enum Valid values ‘Monday’ … ‘Sunday’ The day of the week upon which a new week is considered to start. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarDaysInFirstWeek |
Non-negative Integer Valid values 1 to 7 Specify the number of days of the new year that must fall within the first week. The start of a year usually falls in the middle of a week. If the number of days in that week is less than the value specified here, the week is considered to be the last week of the previous year; hence week 1 starts some days into the new year. Otherwise it is considered to be the first week of the new year; hence week 1 starts some days before the new year. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarCenturyStart |
Non-negative Integer Valid values 0 to 99. This property determines on parsing how two-digit years are interpreted. Specify the two digits that start a 100-year window that contains the current year. For example, if you specify 89, and the current year is 2006, all two-digit dates are interpreted as being in the range 1989 to 2088. A two-digit year less than 89 will be interpreted as 20nn and a two-digit year more than or equal to 89 will be treated as 19nn. Annotation: dfdl:element, dfdl:simpleType |
||||||||
calendarLanguage |
Enum The language that is used when the pattern produces a presentation in text. For example 'Monday' The valid values are as defined by [IETF RFC 3066], Tags for the Identification of Languages, or its successors. For example 'en-GB' Annotation: dfdl:element, dfdl:simpleType |
The dfdl:calendarPattern describes how to parse and unparse text and binary representations of dateTime, date and time logical types. The pattern is primarily used on unparsing to define the format but is also used to aid parsing.
When parsing and unparsing the Pattern is derived from the ICU SimpleDatetimeFormat class described here: http://icu.sourceforge.net/apiref/icu4c/classSimpleDateFormat.html
Extensions are two formatting symbols I and T, which mean accept a subset of ISO 8601 compliant xs:dateTime and xs:time, respectively, and the acceptance of the ‘Z’ character to mean UTC.
Symbol Meaning Presentation Example
G era designator (Text) AD
y year (Number) 1996
Y year (week of year) (Number) 1997
M month in year (Text & Number) July & 07
d day in month (Number) 10
h hour in am/pm (1~12) (Number) 12
H hour in day (0~23) (Number) 0
m minute in hour (Number) 30
s second in minute (Number) 55
S fractional second (see note 1) (Number) 978
E day of week (Text) Tuesday
e day of week (local 1~7) (Text & Number) Tues & 2
D day in year (Number) 189
F day of week in month (Number) 2 (2nd Wed in July)
w week in year (Number) 27
W week in month (Number) 2
a am/pm marker (Text) PM
k hour in day (0~241)
K hour in am/pm (0~11) (Number) 0
z time zone (Text) Pacific Standard Time
Z time zone (RFC 822) (Number) -0800
ZU time zone (RFC 822) (Text) Z
with output "Z" if the
time zone is +00:00)
v time zone (generic) (Text) Pacific Time
V time zone (location) (Text) United States (Los Angeles)
I ISO8601 Date/Time (Text) 2006-10-07T12:06:56.568+01:00
IU ISO8601 Date/Time (Text) 2006-10-07T12:06:56.568Z
with output "Z" if the
time zone is +00:00)
T ISO8601 Time (Text) 12:06:56.568+01:00
(up to HH:mm:ss.SSSZZZ)
TU ISO8601 Time (Text) 12:06:56.568Z
(similar to T, but a time zone
of +00:00 is replaced with 'Z')
' escape for text (Delimiter) 'Date='
'' single quote (Literal) 'o''clock'
Note 1: Any number of fractional seconds "S" may by specified in the pattern and accepted by implementations, but an implementation is free to represent a limited number of fractional seconds internally. Round up rounding must occur when converting between external and internal representations. At least millisecond accuracy must be implemented..
The count of pattern letters determine the format.
(Text): 4 or more, use full form, < 4, use short or abbreviated form if it exists. (e.g., "EEEE" produces "Monday", "EEE" produces "Mon")
(Number): the minimum number of digits. Shorter numbers are zero-padded to this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is handled specially; that is, if the count of 'y' is 2, the Year will be truncated to 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces "97".) Unlike other fields, fractional seconds are padded on the right with zero.
(Text & Number): 3 or over, use text, otherwise use number. (e.g., "M" produces "1", "MM" produces "01", "MMM" produces "Jan", and "MMMM" produces "January".)
Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even if they are not embraced within single quotes.
The 'I' and 'T' pattern characters should be used on their own to format dates and times which match the following subset of the ISO8601 standard.
The restricted profile as proposed by the W3C at http://www.w3.org/TR/NOTE-datetime
Truncated representations of calendar dates, as specified in section 5.2.1.3 of ISO8601:2000
Basic format (subsections c, e, and f)
Extended format (subsections a, b, and d)
Copyright (C) Open Grid Forum (2005-2010). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the OGF or other organizations, except as needed for the purpose of developing Grid Recommendations in which case the procedures for copyrights defined in the OGF Document process must be followed, or as required to translate it into languages other than English.