Last active
March 30, 2016 13:59
-
-
Save martinusso/4c3d27bb9be19af81089 to your computer and use it in GitHub Desktop.
Find out current local time in Time Zone – UTC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
TimeZoneInfo: TTimezoneinformation; | |
Minutes: Integer; | |
Sign: string; | |
begin | |
if not (GetTimezoneInformation(TimeZoneInfo) in [TIME_ZONE_ID_UNKNOWN, TIME_ZONE_ID_STANDARD, TIME_ZONE_ID_DAYLIGHT]) then | |
Result(''); | |
Minutes := (TimeZoneInfo.Bias + TimeZoneInfo.DaylightBias) * -1; | |
if Minutes < 0 then | |
Sign := '-' | |
else | |
Sign := '+'; | |
Result := Sign + FormatDateTime('hh:MM', IncMinute(0, Minutes)); | |
end; |
Author
martinusso
commented
Sep 1, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment