SMMsg suite and time zone for dates

Today I fixed the issue in SMMsg suite for dates in .msg-files. Now the dates processed and converted to local time zone correctly (function FileTimeToElapsedTime)

The correct code is

  function FileTimeToElapsedTime(FileTime: TFileTime): TDateTime;
  var
    SystemTime, LocalSystemTime: TSystemTime;
    TZ: TTimeZoneInformation;
  begin
    Result := 0;
    try
      if FileTimeToSystemTime(FileTime, SystemTime) then
      begin
        if (GetTimeZoneInformation(TZ) <> 0) then
          if SystemTimeToTzSpecificLocalTime(@TZ, SystemTime, LocalSystemTime) then
            Result := SystemTimeToDateTime(LocalSystemTime);
      end;
    except
    end
  end;

Tags: ,

Comments are closed.