8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Optimizations.

This commit is contained in:
Adriano dos Santos Fernandes 2018-12-29 15:36:56 -02:00
parent 54df72afca
commit e3e8d872ec
2 changed files with 9 additions and 4 deletions

View File

@ -429,7 +429,9 @@ void TimeZoneUtil::extractOffset(const ISC_TIMESTAMP_TZ& timeStampTz, int* sign,
{
SSHORT displacement;
if (isOffset(timeStampTz.time_zone))
if (timeStampTz.time_zone == GMT_ZONE)
displacement = 0;
else if (isOffset(timeStampTz.time_zone))
displacement = offsetZoneToDisplacement(timeStampTz.time_zone);
else
{
@ -543,7 +545,9 @@ void TimeZoneUtil::localTimeStampToUtc(ISC_TIMESTAMP_TZ& timeStampTz)
{
int displacement;
if (isOffset(timeStampTz.time_zone))
if (timeStampTz.time_zone == GMT_ZONE)
return;
else if (isOffset(timeStampTz.time_zone))
displacement = offsetZoneToDisplacement(timeStampTz.time_zone);
else
{
@ -600,7 +604,9 @@ void TimeZoneUtil::decodeTimeStamp(const ISC_TIMESTAMP_TZ& timeStampTz, struct t
timeStampTz.utc_timestamp.timestamp_time;
int displacement;
if (isOffset(timeStampTz.time_zone))
if (timeStampTz.time_zone == GMT_ZONE)
displacement = 0;
else if (isOffset(timeStampTz.time_zone))
displacement = offsetZoneToDisplacement(timeStampTz.time_zone);
else
{

View File

@ -371,7 +371,6 @@ public:
ISC_TIMESTAMP_TZ timeStampTz;
timeStampTz.utc_timestamp = req_gmt_timestamp.value();
timeStampTz.time_zone = Firebird::TimeZoneUtil::GMT_ZONE;
Firebird::TimeZoneUtil::localTimeStampToUtc(timeStampTz);
return Firebird::TimeZoneUtil::timeStampTzToTimeStamp(timeStampTz, req_attachment->att_current_timezone);
}