GetDateTimeStamp Function
Returns the current date/time as a string in the Format of: YYYYMMDD-HHMMSSmmm.

Unit
QESBPCSDateTime

Declaration
Function GetDateTimeStamp: string;

Category
Date/Time Arithmetic Routines

Implementation

function GetDateTimeStamp: string;
var
     DT: TDateTime;
     Year, Month, Day: Integer;
     Hr, Min, Sec, MSec: Word;
     Hold: Boolean;
begin
     DT := Now;
     OptDecodeDateI (DT, Year, Month, Day);
     ESBDecodeTime (DT, Hr, Min, Sec, MSec);

     Hold := ESBBlankWhenZero;
     ESBBlankWhenZero := False;
     try
          Result := Int2ZStr (Year, 4) + Int2ZStr (Month, 2) +
               Int2ZStr (Day, 2) + '-' + Int2ZStr (Hr, 2) +
               Int2ZStr (Min, 2) + Int2ZStr (Sec, 2) + Int2ZStr (MSec, 3);
     finally
          ESBBlankWhenZero := Hold;
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com