You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function TimeStamp::decode() used by public isc_decode_timestamp() functions always returns struct tm with its tm_isdst field set to 0 due to a memset() of the whole struct to 0 that is done in the beginning of TimeStamp::decode_date() called by it.
I believe this is wrong as it means that passing the result of localtime() to isc_encode_timestamp() and then using mktime() with the result of isc_decode_timestamp() gives a different value from the one you started with when the DST is in effect.
Ideal would probably be to correctly determine whether the DST is in effect or not but as a minimal fix just setting tm_isdst to -1 in TimeStamp::decode() would be good enough.
Submitted by: Vadim Zeitlin (vz)
The function TimeStamp::decode() used by public isc_decode_timestamp() functions always returns struct tm with its tm_isdst field set to 0 due to a memset() of the whole struct to 0 that is done in the beginning of TimeStamp::decode_date() called by it.
I believe this is wrong as it means that passing the result of localtime() to isc_encode_timestamp() and then using mktime() with the result of isc_decode_timestamp() gives a different value from the one you started with when the DST is in effect.
Ideal would probably be to correctly determine whether the DST is in effect or not but as a minimal fix just setting tm_isdst to -1 in TimeStamp::decode() would be good enough.
Notice that while I encountered this problem with 2.1.4, the code in the latest svn didn't change except that it's now in a different file, see http://firebird.svn.sourceforge.net/viewvc/firebird/firebird/trunk/src/common/classes/NoThrowTimeStamp.cpp?view=markup
The text was updated successfully, but these errors were encountered: