|
|
|
Dates and
Times: Template
|
|
|
DD: # of day of month
(01-31).
T: What follows is a
time in a 24-hour clock.
|
Dates and
Times: Full Datetime Examples
|
|
|
Year must have four
digits.
Month, day, hour, minute,
and second each must have two digits. Single-digit values must be
preceded by a leading zero.
|
|
March 25, 2009 10:29
and 30 seconds p.m.
|
T is always required
before a time.
Times must always be
in military time (for example, 24-hour clock).
Midnight must be written
as 00:00. 24:00 is not valid.
The individual parts
of a date value must be separated by a hyphen (-).
The individual parts
of a time value must be separated by a colon (:).
|
2009-03-25T22:29:30.333+05:00
|
March 25, 2009 10:29
and 30.333 seconds p.m. in the time zone GMT + 5 hours
|
If provided, the time
zone must be in HH:MM format. It cannot be truncated or a partial
value.
Some values in ISO 8601
formats can have decimal places. Most commonly, this is seen in seconds.
The decimal place can be denoted as either a period (.) or a comma
(,).
When a time zone is
provided, it must be accompanied by a complete date. The date cannot
be truncated or a partial value. This is necessary because the 24
global time zones force the date to be considered as part of the time.
|
|
March 25, 2009 10:29
p.m. Zulu time
|
Z can be used to substitute
for times in GMT (or Zulu) time.
|
Dates and
Times: Partial Datetime Examples
(One or more components
of the date or time are not known. Partial values are denoted by a
single -, no matter how many digits are absent. Partial values can
be expressed by truncating the missing parts.)
|
|
No value for the date
is provided.
|
A time value must always
be prefixed by a date value.
In this example, the
date value is completely missing, which would be appropriate for time-only
fields.
|
|
|
Trailing values can
be truncated when the values are missing.
|
|
The 25th day of an unknown
month in the year 2009.
|
If a missing value is
embedded in the string, then it must always be denoted by a hyphen
(-).
|
|
The 25th day of March
in an unknown year.
|
|
|
The 15th minute of an
unknown hour of an unknown day of the third month of an unknown year.
|
Missing year, day, and
hour.
|
|
|
Trailing partial values
can be omitted (truncated).
If time is omitted,
then T must also be omitted.
|
|
The 12th hour of an
unknown day in March 2009.
|
|
|
|
|
A span of time where
n is the number of the unit that follows the unit.
P: indicates that the
value is a duration (period)
T: the elapsed time
in hours, minutes, and seconds
Typically, only the
units with actual values are given. For example, P0Y1M would be P1M.
|
|
|
|
Durations always start
with P for a period of time.
Units of time that are
not known are usually omitted. If time is omitted, then T must also
be omitted.
|
|
The span of zero years
+ zero months + one day.
|
Durations can be expressed
in an alternative format.
When expressed, the
length of time is stored in the same format as date and time, but
preceded by a P. Instead of expressing a specific point in time, it
expresses a period of time.
|
|
The span of 1 year,
2 months, 3 days, 4 hours, 5 minutes, and 6 seconds.
|
The units must be in
the correct order.
The T is required for
all time values, but it should not be specified if no time value is
given.
|
|
PnYnMnDTnHnMnS/YYYY-MM-DDTHH:MM:SS
YYYY-MM-DDTHH:MM:SS/PnYnMnDTnHnMnS
YYYY-MM-DDTHH:MM:SS/PnYnMnDTnHnMnS
YYYY-MM-DDTHH:MM:SS/YYYY-MM-DDTHH:MM:SS
|
|
This is a duration that
is anchored to a specific point in time.
|
|
|
The span of one year
starting on March 25, 2009 at 10:29 p.m.
|
Intervals can express
the period of time that starts at a given point in time.
|
P0001-00-00/2009-03-25T22:29
|
The span of one year
ending on March 25, 2009 at 10:29 p.m.
|
Intervals can express
the period of time that ends at a given point in time.
The start time is implied.
|
|
The span of time between
March 25, 2008 and March 25, 2009, which happens to be one year.
|
Intervals can express
the period of time that starts at a given point in time and ends at
a given point in time.
The duration value itself
is implied.
|