![Page 1: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/1.jpg)
Understanding ISO 8601 date and time representation formats
Understanding ISO 8601 date and time representation formats
Tex TexinDirector, International BusinessProgress Software Corporation
![Page 2: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/2.jpg)
18th International Unicode Conference 2 Hong Kong, April 24-27, 2001
Objectives for this sessionObjectives for this session
ISO 8601:1988 is updated in 2000. What is in ISO 8601:2000? Are there potential pitfalls in using ISO
8601, especially for internationalization? If so, are there workarounds?
![Page 3: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/3.jpg)
18th International Unicode Conference 3 Hong Kong, April 24-27, 2001
Brief Overview of ISO 8601
Problem Areas
Solutions
Brief Overview of ISO 8601
Problem Areas
Solutions
AgendaAgenda
![Page 4: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/4.jpg)
18th International Unicode Conference 4 Hong Kong, April 24-27, 2001
Dates– Calendar dates– Ordinal dates– Week dates
Time of day– Local vs. Universal Time Coordinated (UTC)– Combined data and time
Time-intervals– Recurring time-intervals
ISO 8601:2000 OverviewISO 8601:2000 Overview
![Page 5: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/5.jpg)
18th International Unicode Conference 5 Hong Kong, April 24-27, 2001
Representing dates, times, durations and intervalsRepresenting dates, times, durations and intervals
Uses character representation– ISO/IEC 646, no spaces
Separators (Extended Format)– Hyphens, Colons, Solidus, Number sign
Truncation– Omission of higher order components
Reduced Precision– Omission of lower order components
Expansion- years < 0 or years > 9999 Fixed length fields using leading zeros
![Page 6: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/6.jpg)
18th International Unicode Conference 6 Hong Kong, April 24-27, 2001
Representing dates, times, durations and intervalsRepresenting dates, times, durations and intervals
Designators– “P” is time-interval designator
– “R” is recurring time-interval designator
– “T” indicates start of Time elements
– “W” is week designator
– “Z” is UTC designator Duration designators– Y, M, W, D, H, M, S may be used
– M can be minute, month, or both
![Page 7: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/7.jpg)
18th International Unicode Conference 7 Hong Kong, April 24-27, 2001
Calendar DatesCalendar Dates
Gregorian calendar– 1875 is reference point
– Common (365) and Leap (366) years
– Leap is every 4th year except centennial years that are not integrally divisible by 400
– Gregorian is used even for years < 1582 (by mutual agreement).
– Year 0000 is leap.
![Page 8: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/8.jpg)
18th International Unicode Conference 8 Hong Kong, April 24-27, 2001
Calendar weekCalendar week
Monday is day 1, Sunday is day 7. Weeks are numbered 1- 52 or 1 - 53. Week 1 includes the first Thursday of year.– Alternatively, Week 1 includes Jan 4.
Week 1 may include 3 days of last year.– Last week may include 3 days of next year.
![Page 9: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/9.jpg)
18th International Unicode Conference 9 Hong Kong, April 24-27, 2001
Representing datesRepresenting dates
Calendar date– year, month, day number within month
Ordinal date– year, day number within year
Week date– year, week, number within week
![Page 10: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/10.jpg)
18th International Unicode Conference 10 Hong Kong, April 24-27, 2001
Representing datesRepresenting datesDate Basic Format Extended
FormatCalendar date YYYYMMDD
19850412YYYY-MM-DD1985-04-12
Truncated - - MMDD- - 0412
- - MM-DD- - 04-12
Expanded ±YYYYYYMMDD±0019850412
±YYYYYY-MM-DD±001985-04-12
Ordinal date YYYYDDD1985102
YYYY-DDD1985-102
Week date YYYYWwwD1985W155
YYYY-Www-D1985-W15-5
ReducedPrecision
YYYYWww1985W15
YYYY-Www1985-W15
![Page 11: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/11.jpg)
18th International Unicode Conference 11 Hong Kong, April 24-27, 2001
Dates– Calendar dates– Ordinal dates– Week dates
Time of day– Local vs. Universal Time Coordinated (UTC)– Combined data and time
Time-intervals– Recurring time-intervals
ISO 8601:2000 OverviewISO 8601:2000 Overview
![Page 12: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/12.jpg)
18th International Unicode Conference 12 Hong Kong, April 24-27, 2001
Representing timesRepresenting times
Hours 00-24 (allowing midnight-midnight) Minutes 00-59 Seconds 00-60 (allowing leap seconds) Decimal fractions of hour, minute, second Local and Universal (UTC) time
![Page 13: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/13.jpg)
18th International Unicode Conference 13 Hong Kong, April 24-27, 2001
Representing timesRepresenting times
Time Basic Format ExtendedFormat
Local time hhmmss232050
hh:mm:ss23:20:50
Decimalfractions
hhmmss,ss232050,5
hh:mm:ss,ss23:20:50,5
Universal time hhmmssZ232050Z
hh:mm:ssZ23:20:50Z
Local time offsetUTC
hhmmss±hhmm232050+0100
hh:mm:ss±hh:mm23:20:50+01:00
![Page 14: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/14.jpg)
18th International Unicode Conference 14 Hong Kong, April 24-27, 2001
Combined date and timeCombined date and time
“T” indicates start of time Mix and match as needed:
Calendar dates + local timeYYYY-MM-DDThh:mm
Ordinal dates + UTC timeYYYY-DDDThh:mmZ
Week dates + offset from UTCYYYYWwwDThh:mm±hhmm
![Page 15: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/15.jpg)
18th International Unicode Conference 15 Hong Kong, April 24-27, 2001
Dates– Calendar dates– Ordinal dates– Week dates
Time of day– Local vs. Universal Time Coordinated (UTC)– Combined data and time
Time-intervals– Recurring time-intervals
ISO 8601:2000 OverviewISO 8601:2000 Overview
![Page 16: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/16.jpg)
18th International Unicode Conference 16 Hong Kong, April 24-27, 2001
Representing time-intervalsRepresenting time-intervals
“P” indicates a duration (period) Intervals come in 4 varieties:– start and end times
YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss
– durationsPnYnMnDTnHnMnS
P2Y10M15DT10H30M20S
2 Yr, 10 mon, 15 days, 10 hrs. 30 min. 20 sec.
P6W is a duration of 6 weeks.
![Page 17: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/17.jpg)
18th International Unicode Conference 17 Hong Kong, April 24-27, 2001
Representing time-intervalsRepresenting time-intervals
The remaining 2 varieties– start time and durationYYYY-MM-DDThh:mm:ss/PnYnMnDTnHnMnS or
YYYY-MM-DDThh:mm:ss/PYYYY-MM-DDThh:mm:ss
1985-04-12T23:20:50/P0001-02-15T12:30:00
– duration and end timePnYnMnDTnHnMnS/YYYY-MM-DDThh:mm:ss or
PYYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss
![Page 18: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/18.jpg)
18th International Unicode Conference 18 Hong Kong, April 24-27, 2001
Recurring time-intervalsRecurring time-intervals
Recurring time intervals are expressed by:– # of recurrences and start and end times
– # of recurrences and a duration
– # of recurrences & start time & a duration
– # of recurrences & duration & end time If # of recurrences is not provided than the
number is unbounded “R” is used to indicate recursion
![Page 19: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/19.jpg)
18th International Unicode Conference 19 Hong Kong, April 24-27, 2001
Recurring with Start and End Times:
Rn/YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss
R12/1985-04-12T23:20:50/1985-06-25T10:30:00
Recurring with a duration:
Rn/PnYnMnDTnHnMnS
R12/P2Y10M15DT10H20M20S
Recurring with a Start Time and duration:
Rn/YYYY-MM-DDThh:mm:ss/PnYnMnDTnHnMnS
R12/1985-04-12T23:20:50/P2Y2M15DT12H30M0S
Examples of recurring time-intervalsExamples of recurring time-intervals
![Page 20: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/20.jpg)
18th International Unicode Conference 20 Hong Kong, April 24-27, 2001
Brief Overview of ISO 8601
Problem Areas
Solutions
Brief Overview of ISO 8601
Problem Areas
Solutions
AgendaAgenda
![Page 21: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/21.jpg)
18th International Unicode Conference 21 Hong Kong, April 24-27, 2001
AmbiguitiesAmbiguities
Future leap seconds are unpredictableIs 2010-03-31T23:59:60Z valid?
Year, month, minute have varying sizesP1M = P28D or P29D or P30D or P31D
Mismatched precision1985W50 <= 1985W501?
Truncation opens the door for Y2K issues Variations of 8601 exist in practice– Julian, Gregorian, Emperor...
![Page 22: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/22.jpg)
18th International Unicode Conference 22 Hong Kong, April 24-27, 2001
AmbiguitiesAmbiguities
Date arithmetic is not defined2001-03-30 + P1M = 2001-04-29 (Add 30 days)
2001-03-30 + P1M = 2001-04-30 (Add 1 mon.) Addition is not commutative or associative
2001-03-30 + P1D + P1M = 2001-04-30
2001-03-30 + P1M + P1D = 2001-05-01 Subtraction is not the inverse of Addition Precision of decimal fractions can vary
![Page 23: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/23.jpg)
18th International Unicode Conference 23 Hong Kong, April 24-27, 2001
ConversionsConversions
Gregorian calendar adopted at different times around the world
Most calendars do not include year 0. 8601 extends leap years into the past, other
calendars do not. Dates without times are often not qualified
by time zone.– Time zones (currently) go from -13 to +12
– So the date could be +/- 1 day
![Page 24: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/24.jpg)
18th International Unicode Conference 24 Hong Kong, April 24-27, 2001
Brief Overview of ISO 8601
Problem Areas
Solutions
Brief Overview of ISO 8601
Problem Areas
Solutions
AgendaAgenda
![Page 25: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/25.jpg)
18th International Unicode Conference 25 Hong Kong, April 24-27, 2001
SolutionsSolutions
Mutual Agreements Referencing other standards and
implementations– e.g. Java
Standards employing 8601 may need to introduce rules or constraints– e.g. XML Schema
Restrict use of 8601 formats
![Page 26: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/26.jpg)
18th International Unicode Conference 26 Hong Kong, April 24-27, 2001
Mark Davis (IBM)
www.macchiato.com/unicode/timeIntervals.htm W3C Internationalization working and interest
groups
AcknowledgementsAcknowledgements
![Page 27: Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation](https://reader036.vdocuments.us/reader036/viewer/2022062417/55150753550346c77d8b465c/html5/thumbnails/27.jpg)
18th International Unicode Conference 27 Hong Kong, April 24-27, 2001
Questions