JSON-159: After ENGINE-780 we have timegm_with_gmtoff() which does the right thing on all platforms.
authorRoker <roker@pep-project.org>
Wed, 29 Jul 2020 00:50:40 +0200
changeset 1026b0aede2f1bc5
parent 1024 627cd00b19a3
child 1027 56414b64b06e
JSON-159: After ENGINE-780 we have timegm_with_gmtoff() which does the right thing on all platforms.
server/inout.cc
     1.1 --- a/server/inout.cc	Tue Jul 28 18:37:10 2020 +0200
     1.2 +++ b/server/inout.cc	Wed Jul 29 00:50:40 2020 +0200
     1.3 @@ -169,10 +169,7 @@
     1.4  		return js::Value{};
     1.5  	}
     1.6  	
     1.7 -	// neither timegm() nor mktime() respect t->tm_gmtoff for their conversions. What a mess!
     1.8 -	// But t->tm_gmtoff is non-standard, though, and doesn't exist on MS Windows. In ENGINE-735
     1.9 -	// we switched to `timestamp` to cater for Windows and now convert to UTC in Windows' `timegm`.
    1.10 -	const int64_t u = timegm(t);
    1.11 +	const int64_t u = timegm_with_gmtoff(t);
    1.12  	return js::Value{u};
    1.13  }
    1.14