title: Is there a cross-plaform method to convert from local time to UTC?
body: <p>How to convert from local time to UTC on all platforms (Android/iOS/Mac/Windows)? On windows I use this function:</p>
  
  <pre><code>function AlLocalDateTimeToGMTDateTime(Const aLocalDateTime: TDateTime): TdateTime;
  
    {--------------------------------------------}
    function InternalCalcTimeZoneBias : TDateTime;
    const Time_Zone_ID_DayLight = 2;
    var TZI: TTimeZoneInformation;
        TZIResult: Integer;
        aBias : Integer;
    begin
      TZIResult := GetTimeZoneInformation(TZI);
      if TZIResult = -1 then Result := 0
      else begin
        if TZIResult = Time_Zone_ID_DayLight then aBias := TZI.Bias + TZI.DayLightBias
        else aBias := TZI.Bias + TZI.StandardBias;
        Result := EncodeTime(Abs(aBias) div 60, Abs(aBias) mod 60, 0, 0);
        if aBias &lt; 0 then Result := -Result;
      end;
    end;
  
  begin
    Result := aLocalDateTime + InternalCalcTimeZoneBias;
  end;
  </code></pre>
  
  <p>Is there a cross-platform equivalent that I can use?</p>