{------------------------------------------------------------------------------}
{
   Unit Name: kTimeStr
   Purpose  : Date & time as string
   Author   : Vesa Lappalainen
   Date     : 8.2.2001
   Changed  :

   ToDo     :
}
{------------------------------------------------------------------------------}

unit kTimeStr;

interface
uses SysUtils;

function NowToStr:string;
function NowTo4Str:string;

implementation

function NowToStr:string;
var Hour,Min,Sec,MSec:Word; s:string;
begin
  DecodeTime(Time,Hour,Min,Sec,MSec);
  MSec := MSec div 10;
  s := IntToStr(MSec); if ( Length(s) < 2 ) then s := '0'+s;
  Result := FormatDateTime('yymmdd hhnnss',now)+'.'+s;
end;

function NowTo4Str:string;
var Hour,Min,Sec,MSec:Word; s:string;
begin
  DecodeTime(Time,Hour,Min,Sec,MSec);
  MSec := MSec div 10;
  s := IntToStr(MSec); if ( Length(s) < 2 ) then s := '0'+s;
  Result := FormatDateTime('yyyymmdd hhnnss',now)+'.'+s;
end;

end.
 