Hi all,
I think i found bug on GetLocalTimeOffset, This method is in SysUtils unit. they did not response correctly
, when I access method
LocalTimeToUniversal(Now, GetLocalTimeOffset);
Here, in my country, localtime is GMT+7, so the integer value is 420, but GetLocalTimeOffset return -420
LocalTimeToUniversal code is here ..
Function LocalTimeToUniversal(LT: TDateTime;TZOffset: Integer): TDateTime;
begin
if (TZOffset > 0) then
Result := LT - EncodeTime(TZOffset div 60, TZOffset mod 60, 0, 0)
else if (TZOffset < 0) then
Result := LT + EncodeTime(Abs(TZOffset) div 60, Abs(TZOffset) mod 60, 0, 0)
else
Result := LT;
end;
I tried it on Windows 8.1 and Mac OS X El-Capitan, fpc 3.0.0
herux