Presentation is loading. Please wait.

Presentation is loading. Please wait.

Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation.

Similar presentations


Presentation on theme: "Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation."— Presentation transcript:

1 Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation

2 18th International Unicode Conference 2 Hong Kong, April 24-27, 2001 Objectives for this session n ISO 8601:1988 is updated in 2000. n What is in ISO 8601:2000? n Are there potential pitfalls in using ISO 8601, especially for internationalization? n If so, are there workarounds?

3 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 Agenda

4 18th International Unicode Conference 4 Hong Kong, April 24-27, 2001 n Dates –Calendar dates –Ordinal dates –Week dates n Time of day –Local vs. Universal Time Coordinated (UTC) –Combined data and time n Time-intervals –Recurring time-intervals ISO 8601:2000 Overview

5 18th International Unicode Conference 5 Hong Kong, April 24-27, 2001 Representing dates, times, durations and intervals n Uses character representation –ISO/IEC 646, no spaces n Separators (Extended Format) –Hyphens, Colons, Solidus, Number sign n Truncation –Omission of higher order components n Reduced Precision –Omission of lower order components n Expansion- years 9999 n Fixed length fields using leading zeros

6 18th International Unicode Conference 6 Hong Kong, April 24-27, 2001 Representing dates, times, durations and intervals n 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 n Duration designators –Y, M, W, D, H, M, S may be used –M can be minute, month, or both

7 18th International Unicode Conference 7 Hong Kong, April 24-27, 2001 Calendar Dates n 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.

8 18th International Unicode Conference 8 Hong Kong, April 24-27, 2001 Calendar week n Monday is day 1, Sunday is day 7. n Weeks are numbered 1- 52 or 1 - 53. n Week 1 includes the first Thursday of year. –Alternatively, Week 1 includes Jan 4. n Week 1 may include 3 days of last year. –Last week may include 3 days of next year.

9 18th International Unicode Conference 9 Hong Kong, April 24-27, 2001 Representing dates n Calendar date –year, month, day number within month n Ordinal date –year, day number within year n Week date –year, week, number within week

10 18th International Unicode Conference 10 Hong Kong, April 24-27, 2001 Representing dates

11 18th International Unicode Conference 11 Hong Kong, April 24-27, 2001 n Dates –Calendar dates –Ordinal dates –Week dates n Time of day –Local vs. Universal Time Coordinated (UTC) –Combined data and time n Time-intervals –Recurring time-intervals ISO 8601:2000 Overview

12 18th International Unicode Conference 12 Hong Kong, April 24-27, 2001 Representing times n Hours 00-24 (allowing midnight-midnight) n Minutes 00-59 n Seconds 00-60 (allowing leap seconds) n Decimal fractions of hour, minute, second n Local and Universal (UTC) time

13 18th International Unicode Conference 13 Hong Kong, April 24-27, 2001 Representing times

14 18th International Unicode Conference 14 Hong Kong, April 24-27, 2001 Combined date and time n T indicates start of time n Mix and match as needed: Calendar dates + local time YYYY-MM-DDThh:mm Ordinal dates + UTC time YYYY-DDDThh:mmZ Week dates + offset from UTC YYYYWwwDThh:mm±hhmm

15 18th International Unicode Conference 15 Hong Kong, April 24-27, 2001 n Dates –Calendar dates –Ordinal dates –Week dates n Time of day –Local vs. Universal Time Coordinated (UTC) –Combined data and time n Time-intervals –Recurring time-intervals ISO 8601:2000 Overview

16 18th International Unicode Conference 16 Hong Kong, April 24-27, 2001 Representing time-intervals n P indicates a duration (period) n Intervals come in 4 varieties: –start and end times YYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss –durations PnYnMnDTnHnMnS P2Y10M15DT10H30M20S 2 Yr, 10 mon, 15 days, 10 hrs. 30 min. 20 sec. P6W is a duration of 6 weeks.

17 18th International Unicode Conference 17 Hong Kong, April 24-27, 2001 Representing time-intervals n The remaining 2 varieties –start time and duration YYYY-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 time PnYnMnDTnHnMnS/YYYY-MM-DDThh:mm:ss or PYYYY-MM-DDThh:mm:ss/YYYY-MM-DDThh:mm:ss

18 18th International Unicode Conference 18 Hong Kong, April 24-27, 2001 Recurring time-intervals n 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 n If # of recurrences is not provided than the number is unbounded n R is used to indicate recursion

19 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-intervals

20 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 Agenda

21 18th International Unicode Conference 21 Hong Kong, April 24-27, 2001 Ambiguities n Future leap seconds are unpredictable Is 2010-03-31T23:59:60Z valid? n Year, month, minute have varying sizes P1M = P28D or P29D or P30D or P31D n Mismatched precision 1985W50 <= 1985W501? n Truncation opens the door for Y2K issues n Variations of 8601 exist in practice –Julian, Gregorian, Emperor...

22 18th International Unicode Conference 22 Hong Kong, April 24-27, 2001 Ambiguities n Date arithmetic is not defined 2001-03-30 + P1M = 2001-04-29 (Add 30 days) 2001-03-30 + P1M = 2001-04-30 (Add 1 mon.) n Addition is not commutative or associative 2001-03-30 + P1D + P1M = 2001-04-30 2001-03-30 + P1M + P1D = 2001-05-01 n Subtraction is not the inverse of Addition n Precision of decimal fractions can vary

23 18th International Unicode Conference 23 Hong Kong, April 24-27, 2001 Conversions n Gregorian calendar adopted at different times around the world n Most calendars do not include year 0. n 8601 extends leap years into the past, other calendars do not. n 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

24 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 Agenda

25 18th International Unicode Conference 25 Hong Kong, April 24-27, 2001 Solutions n Mutual Agreements n Referencing other standards and implementations –e.g. Java n Standards employing 8601 may need to introduce rules or constraints –e.g. XML Schema n Restrict use of 8601 formats

26 18th International Unicode Conference 26 Hong Kong, April 24-27, 2001 n Mark Davis (IBM) www.macchiato.com/unicode/timeIntervals.htm n W3C Internationalization working and interest groups Acknowledgements

27 18th International Unicode Conference 27 Hong Kong, April 24-27, 2001 Questions


Download ppt "Understanding ISO 8601 date and time representation formats Tex Texin Director, International Business Progress Software Corporation."

Similar presentations


Ads by Google