MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / decodeTimeStampWithFallback

Function decodeTimeStampWithFallback

src/yvalve/utl.cpp:728–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

726}
727
728void 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, &times, &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
768void UtilInterface::decodeTimeStampTz(CheckStatusWrapper* status, const ISC_TIMESTAMP_TZ* timeStampTz,
769 unsigned* year, unsigned* month, unsigned* day, unsigned* hours, unsigned* minutes, unsigned* seconds,

Callers 2

decodeTimeStampTzMethod · 0.85
decodeTimeStampTzExMethod · 0.85

Calls 2

formatFunction · 0.85
stuffExceptionMethod · 0.45

Tested by

no test coverage detected