| 726 | } |
| 727 | |
| 728 | void decodeTimeStampWithFallback(CheckStatusWrapper* status, const ISC_TIMESTAMP_TZ* timeStampTz, SLONG gmtFallback, |
| 729 | unsigned* year, unsigned* month, unsigned* day, unsigned* hours, unsigned* minutes, unsigned* seconds, |
| 730 | unsigned* fractions, unsigned timeZoneBufferLength, char* timeZoneBuffer) |
| 731 | { |
| 732 | try |
| 733 | { |
| 734 | tm times; |
| 735 | int intFractions; |
| 736 | bool tzLookup = TimeZoneUtil::decodeTimeStamp(*timeStampTz, true, gmtFallback, ×, &intFractions); |
| 737 | |
| 738 | if (year) |
| 739 | *year = times.tm_year + 1900; |
| 740 | |
| 741 | if (month) |
| 742 | *month = times.tm_mon + 1; |
| 743 | |
| 744 | if (day) |
| 745 | *day = times.tm_mday; |
| 746 | |
| 747 | if (hours) |
| 748 | *hours = times.tm_hour; |
| 749 | |
| 750 | if (minutes) |
| 751 | *minutes = times.tm_min; |
| 752 | |
| 753 | if (seconds) |
| 754 | *seconds = times.tm_sec; |
| 755 | |
| 756 | if (fractions) |
| 757 | *fractions = (unsigned) intFractions; |
| 758 | |
| 759 | if (timeZoneBuffer) |
| 760 | TimeZoneUtil::format(timeZoneBuffer, timeZoneBufferLength, timeStampTz->time_zone, !tzLookup, gmtFallback); |
| 761 | } |
| 762 | catch (const Exception& ex) |
| 763 | { |
| 764 | ex.stuffException(status); |
| 765 | } |
| 766 | } |
| 767 | |
| 768 | void UtilInterface::decodeTimeStampTz(CheckStatusWrapper* status, const ISC_TIMESTAMP_TZ* timeStampTz, |
| 769 | unsigned* year, unsigned* month, unsigned* day, unsigned* hours, unsigned* minutes, unsigned* seconds, |
no test coverage detected