License:
Version:
Author:
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | Time t; ExtendedDate ed; parseDate("19", t); // January 1st, 1900 parseDate("1970", t); // January 1st, 1970 parseDate("1970-02", t); // February 1st, 1970 parseDate("19700203", t); // February 3rd, 1970 parseDate("+19700203", ed, 2); // March 1st, 197002 parseDate("-197002-04-01", ed, 2); // April 1st, -197003 (197003 BCE) parseDate("00000101", t); // January 1st, -1 (1 BCE) parseDate("1700-W14-2", t); // April 6th, 1700 parseDate("2008W01", t); // December 31st, 2007 parseDate("1987-221", t); // August 9th, 1987 parseDate("1234abcd", t); // January 1st, 1234; return value is 4 parseDate("12abcdef", t); // January 1st, 1200; return value is 2 parseDate("abcdefgh", t); // January 1st, 0001; return value is 0 |
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | Time t; ExtendedDate ed; // ",000" omitted for clarity parseTime("20", t); // 20:00:00 parseTime("2004", t); // 20:04:00 parseTime("20:04:06", t); // 20:04:06 parseTime("16:49:30,001", t); // 16:49:30,001 parseTime("16:49:30,1", t); // 16:49:30,100 parseTime("16:49,4", t); // 16:49:24 parseTime("23:59:60", ed); // 23:59:60 parseTime("24:00:01", t); // 00:00:00; return value is 5 parseTime("24:00:01", ed); // 00:00:00; return value is 5; endOfDay parseTime("30", t); // 00:00:00; return value is 0 parseTime("21:32:43-12:34", t); // 10:06:43; day increased by one |
parseTime:
Examples:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Time t; // January 1st, 2008 00:01:00 parseDateAndTime("2007-12-31T23:01-01", t); // April 12th, 1985 23:50:30,042 parseDateAndTime("1985W155T235030,042", t); // Invalid time: returns zero parseDateAndTime("1902-03-04T10:1a", t); // Separating T omitted: returns zero parseDateAndTime("1985-04-1210:15:30+04:00", t); // Inconsistent separators: all return zero parseDateAndTime("200512-01T10:02", t); parseDateAndTime("1985-04-12T10:15:30+0400", t); parseDateAndTime("1902-03-04T050607", t); |