unit time;

interface

uses Windows, SysUtils, ex2;

function CTime(Time : Long) : String;
function CurrentCTime : ULong;

implementation

function CTime(Time : Long) : String;
var
   Date : TDateTime;
   TZInfo : TTimeZoneInformation;
begin
   GetTimeZoneInformation(TZInfo);
   Date := ((Time - (TZInfo.Bias * 60))/ 86400) + 25569;
   Result := FormatDateTime('dd/mm/yy hh:mm', Date);
end;

function CurrentCTime : ULong;
var
   Date : TDateTime;
   TZInfo : TTimeZoneInformation;
begin
   GetTimeZoneInformation(TZInfo);
   Date := Now;

   Result := Round(((Date - 25569) * 86400) + (TZInfo.Bias * 60));
end;

end.
