ZVON > References > Dates and Times Reference

Miloslav Nic

Numeric representation of dates and times

Based on the international standard ISO 8601: Data elements and interchange formats

This reference has been developed for Zvon, where you can find both basic and advanced tutorials about XSLT, XML, DTD, Mozilla, CSS, regular expressions, ...

Contents:
Characters used in place of digits
Characters used as designators
 
Date indentified by month and day numbers: complete representation
representation with reduced precision
truncated representations
 
Date identified by day numbers: complete representation
truncated representation
 
Date identified by week and day numbers: complete representation
representation with reduced precision
truncated representation
 
Time of the day: complete representation
representations with reduced precision
decimal fractions
truncated representations
 
Coordinated Universal Time (UTC): UTC
differences between local time and UTC
 
Combination of date and time: calendar date and local time
 
Periods of time: complete representations

Characters used in place of digits

C thousands and hundreds years (centuries)
Y tens and individual years
M months
D days [start at 00:00 and end at 24:00 (00:00 of the next day), as a day of the week Monday is 1 and Sunday is 7]
w weeks [the first calendar week of the year is the one that includes the first Thursday of that year]
h hours
m minutes
s seconds
n digits (positive integers)

Characters used as designators

P period designator, preceeds a duration of a period of time
T time designator, starts representation of time when date and time are combined
W week designator, starts the ordinal number of a calendar week within the year
Z time-zone designator, follows time of the day in Coordinated Universal Time (UTC)

Date indentified by month and day numbers
complete representation
full date
basic notation: CCYYMMDD extended notation: CCYY-MM-DD

19890312
(12th March 1989)

1989-03-12
(12th March 1989)


representation with reduced precision
specific month
basic notation: CCYY-MM extended notation: not applicable

2000-02
(February 2000)


specific year
basic notation: CCYY extended notation: not applicable

1988
(year 1988)


specific century
basic notation: CC extended notation: not applicable

19
(20th century)


truncated representations
specific date in the current century
basic notation: YYMMDD extended notation: YY-MM-DD

000108
(8th January 2000)

00-01-08
(8th January 2000)


specific year and month in the current century
basic notation: -YYMM extended notation: -YY-MM

-0003
(March 2000)

-00-03
(March 2000)


specific year in the current century
basic notation: -YY extended notation: not applicable

-56
(year 2056)


specific day of a month
basic notation: --MMDD extended notation: --MM-DD

--0806
(6th August)

--08-06
(6th August)


specific month
basic notation: --MM extended notation: not applicable

--05
(May)


specific day
basic notation: ---DD extended notation: not applicable

---06
(6th day)



Date identified by day numbers
complete representation
a full date
basic notation: CCYYDDD extended notation: CCYY-DDD

2001060
(1st March 2001)

2001-060
(1st March 2001)


truncated representation
specific year and day in the current century
basic notation: YYDDD extended notation: YY-DDD

05365
(31st December 2005)

05-365
(31st December 2005)


a day of a year
basic notation: -DDD extended notation: not applicable

-032
(1st February)



Date identified by week and day numbers
complete representation
full date
basic notation: CCYYWwwD extended notation: CCYY-Www-D

2052W086
(24th February 2052(Saturday))

2052-W08-6
(24th February 2052(Saturday))


representation with reduced precision
a week in the specific year
basic notation: CCYYWww extended notation: CCYY-Www

2016W06
(6th week of the year 2016)

2016-W06
(6th week of the year 2016)


truncated representation
year, week and day in the current century
basic notation: YYWwwD extended notation: YY-Www-D

52W086
(24th February 2052(Saturday))

52-W08-6
(24th February 2052(Saturday))


year and week in the current century
basic notation: YYWww extended notation: YY-Www

16W06
(6th week of the year 2016)

16-W06
(6th week of the year 2016)


year, week, and day of the current decade
basic notation: -YWwwD extended notation: -Y-WwwD

-7W103
(7th March 2007 (Wednesday))

-7-W10-3
(7th March 2007 (Wednesday))


week and day of the current year
basic notation: -WwwD extended notation: -Www-D

-W014
(6th January 2000 (Thursday))

-W014
(6th January 2000 (Thursday))


week of the current year
basic notation: -Wwww extended notation: not applicable

-W25
(25th week of the year)


day of the current week
basic notation: -W-D extended notation: not applicable

-W-5
(Friday of this week)


day of any week
basic notation: ---D extended notation: not applicable

---5
(Friday)



Time of the day
complete representation
full time
basic notation: hhmmss extended notation: hh:mm:ss

150603
(15 hours 6 minutes 3 seconds)

15:06:03
(15 hours 6 minutes 3 seconds)


representations with reduced precision
hours and minutes
basic notation: hhmm extended notation: hh:mm

0608
(6 hours 8 minutes)

06:08
(6 hours 8 minutes)


hours
basic notation: hh extended notation: not applicable

03
(3 hours)


decimal fractions
fraction of seconds
basic notation: hhmmss,s | hhmmss.s extended notation: hh:mm:ss,s | hh:mm:ss.s

064312,234
(6 hours 43 minutes 12.234 seconds)

064312.234
(6 hours 43 minutes 12.234 seconds)

06:43:12,234
(6 hours 43 minutes 12.234 seconds)

06:43:12.234
(6 hours 43 minutes 12.234 seconds)


fraction of minutes
basic notation: hhmm,m | hhmm.m extended notation: hh:mm,m | hh:mm.m

0643,12
(6 hours 43.12 minutes)

0643.12
(6 hours 43.12 minutes)

06:43,12
(6 hours 43.12 minutes)

06:43.12
(6 hours 43.12 minutes)


fraction of hours
basic notation: hh,h | hh.h extended notation: not applicable

06,125
(6.125 hours)

06.125
(6.125 hours)


truncated representations
specific minute and second of the hour
basic notation: -mmss extended notation: -mm:ss

-0804
(8 minutes 4 seconds)

-08:04
(8 minutes 4 seconds)


specific minute of the hour
basic notation: -mm extended notation: not applicable

-08
(8th minute)


specific second of the minute
basic notation: --ss extended notation: not applicable

--07
(7th second)



Coordinated Universal Time (UTC)
UTC
full date
basic notation: hhmmssZ extended notation: hh:mm:ssZ

061223Z
(6 hours 12 minutes 23 seconds UTC)

06:12:23Z
(6 hours 12 minutes 23 seconds UTC)


hours and minutes
basic notation: hhmmZ extended notation: hh:mmZ

0612Z
(6 hours 12 minutes UTC)

06:12Z
(6 hours 12 minutes UTC)


hours
basic notation: hhZ extended notation: not applicable

06Z
(6 hours UTC)


differences between local time and UTC
local time ahead
basic notation: hhmmss+hhmm | hhmmss+hh extended notation: hh:mm:ss+hh:mm | hh:mm:ss+hh

051207+0100
(5 hours 12 minutes 7 seconds in Prague)

051207+01
(5 hours 12 minutes 7 seconds in Prague)

05:12:07+01:00
(5 hours 12 minutes 7 seconds in Prague)

05:12:07+01
(5 hours 12 minutes 7 seconds in Prague)


local time behind
basic notation: hhmmss-hhmm | hhmmss-hh extended notation: hh:mm:ss-hh:mm | hh:mm:ss-hh

051207-0500
(5 hours 12 minutes 7 seconds in New York)

051207-05
(5 hours 12 minutes 7 seconds in New York)

05:12:07-05:00
(5 hours 12 minutes 7 seconds in New York)

05:12:07-05
(5 hours 12 minutes 7 seconds in New York)



Combination of date and time
calendar date and local time
complete representation
basic notation: CCYYMMDDThhmmss extended notation: CCYY-MM-DDThh:mm:ss

20021207T062307
(7th December 2002 in 6 hours 23 minutes 7 seconds)

2002-12-07T06:23:07
(7th December 2002 in 6 hours 23 minutes 7 seconds)


examples of reduced representation
basic notation: anyTany extended notation: anyTany

030303T12
(12th hour of the 3rd March 2003)

03-03-03T12
(12th hour of the 3rd March 2003)



Periods of time
complete representations
period identified by its start and end
basic notation: CCYYMMDDThhmmss/CCYYMMDDThhmmss extended notation: not applicable

20000812T161223/20050505T050505
(period from 16 hours 12 minutes 23 seconds of 12th August 2000 till 5 hours 5 minutes 5 seconds of 5th May 2005)


period represented by its duration
basic notation: PnYnMnDTnHnMnS | PnW extended notation: not applicable

P12Y6M24DT6H12M23S
(period of 12 years 6 months 24 days 6 hours 12 minutes and 23 seconds)

P23W
(period of 23 weeks)


period represented by its start and its duration
basic notation: CCYYMMDDThhmmss/PnYnMnDTnHnMnS extended notation: not applicable

20000423/P5Y4M12DT3H23M9S
(period of 5 years 4 months 12 days 3 hours 23 minutes 9 seconds starting on 23 April 2005)


period represented by its end and its duration
basic notation: PnYnMnDTnHnMnS/CCYYMMDDThhmmss extended notation: not applicable

P5Y4M12DT3H23M9S/20000423
(period of 5 years 4 months 12 days 3 hours 23 minutes 9 seconds ending on 23 April 2005)