Converts a time-tz to timestamp-tz.
| 950 | |
| 951 | // Converts a time-tz to timestamp-tz. |
| 952 | ISC_TIMESTAMP_TZ TimeZoneUtil::timeTzToTimeStampTz(const ISC_TIME_TZ& timeTz, Callbacks* cb) |
| 953 | { |
| 954 | // SQL: Copy date fields from CURRENT_DATE and time and time zone fields from the source. |
| 955 | |
| 956 | struct tm localTimes; |
| 957 | TimeStamp::decode_date(cb->getLocalDate(), &localTimes); |
| 958 | |
| 959 | ISC_TIMESTAMP_TZ tsTz; |
| 960 | tsTz.time_zone = timeTz.time_zone; |
| 961 | tsTz.utc_timestamp.timestamp_date = TIME_TZ_BASE_DATE; |
| 962 | tsTz.utc_timestamp.timestamp_time = timeTz.utc_time; |
| 963 | |
| 964 | struct tm times; |
| 965 | int fractions; |
| 966 | decodeTimeStamp(tsTz, false, NO_OFFSET, ×, &fractions); |
| 967 | |
| 968 | times.tm_mday = localTimes.tm_mday; |
| 969 | times.tm_mon = localTimes.tm_mon; |
| 970 | times.tm_year = localTimes.tm_year; |
| 971 | |
| 972 | tsTz.utc_timestamp = TimeStamp::encode_timestamp(×, fractions); |
| 973 | localTimeStampToUtc(tsTz); |
| 974 | |
| 975 | return tsTz; |
| 976 | } |
| 977 | |
| 978 | // Converts a time-tz to timestamp. |
| 979 | ISC_TIMESTAMP TimeZoneUtil::timeTzToTimeStamp(const ISC_TIME_TZ& timeTz, Callbacks* cb) |
nothing calls this directly
no test coverage detected