| 601 | |
| 602 | |
| 603 | void CVT_string_to_datetime(const dsc* desc, |
| 604 | ISC_TIMESTAMP_TZ* date, bool* timezone_present, |
| 605 | const EXPECT_DATETIME expect_type, bool allow_special, Callbacks* cb) |
| 606 | { |
| 607 | /************************************** |
| 608 | * |
| 609 | * s t r i n g _ t o _ d a t e t i m e |
| 610 | * |
| 611 | ************************************** |
| 612 | * |
| 613 | * Functional description |
| 614 | * Convert an arbitrary string to a date and/or time. |
| 615 | * |
| 616 | * String must be formed using ASCII characters only. |
| 617 | * Conversion routine can handle the following input formats |
| 618 | * "now" current date & time |
| 619 | * "today" Today's date 0:0:0.0 time |
| 620 | * "tomorrow" Tomorrow's date 0:0:0.0 time |
| 621 | * "yesterday" Yesterday's date 0:0:0.0 time |
| 622 | * YYYY-MM-DD [HH:[Min:[SS.[Thou]]]]] |
| 623 | * MM:DD[:YY [HH:[Min:[SS.[Thou]]]]] |
| 624 | * DD.MM[:YY [HH:[Min:[SS.[Thou]]]]] |
| 625 | * Where: |
| 626 | * DD = 1 .. 31 (Day of month) |
| 627 | * YY = 00 .. 99 2-digit years are converted to the nearest year |
| 628 | * in a 50 year range. Eg: if this is 1996 |
| 629 | * 96 ==> 1996 |
| 630 | * 97 ==> 1997 |
| 631 | * ... |
| 632 | * 00 ==> 2000 |
| 633 | * 01 ==> 2001 |
| 634 | * ... |
| 635 | * 44 ==> 2044 |
| 636 | * 45 ==> 2045 |
| 637 | * 46 ==> 1946 |
| 638 | * 47 ==> 1947 |
| 639 | * ... |
| 640 | * 95 ==> 1995 |
| 641 | * If the current year is 1997, then 46 is converted |
| 642 | * to 2046 (etc). |
| 643 | * = 100.. 5200 (Year) |
| 644 | * MM = 1 .. 12 (Month of year) |
| 645 | * = "JANUARY"... (etc) |
| 646 | * HH = 0 .. 23 (Hour of day) |
| 647 | * Min = 0 .. 59 (Minute of hour) |
| 648 | * SS = 0 .. 59 (Second of minute - LEAP second not supported) |
| 649 | * Thou = 0 .. 9999 (Fraction of second) |
| 650 | * HH, Min, SS, Thou default to 0 if missing. |
| 651 | * YY defaults to current year if missing. |
| 652 | * Note: ANY punctuation can be used instead of : (eg: / - etc) |
| 653 | * Using . (period) in either of the first two separation |
| 654 | * points will cause the date to be parsed in European DMY |
| 655 | * format. |
| 656 | * Arbitrary whitespace (space or TAB) can occur between |
| 657 | * components. |
| 658 | * |
| 659 | **************************************/ |
| 660 |
no test coverage detected