Skip to content

TimeStampToDateTime

Convert a TimeStamp value to a TDateTime value.

Declaration

Source position: datih.inc line 114

  function TimeStampToDateTime(const TimeStamp: TTimeStamp) : TDateTime;

Description

TimeStampToDateTime converts TimeStamp to a TDateTime format variable. It is the inverse operation of DateTimeToTimeStamp .

Errors

None.

See also

Name Description
DateTimeToTimeStamp Converts a TDateTime value to a TimeStamp structure.
TimeStampToMSecs Converts a timestamp to a number of milliseconds.

Example

Program Example24;
{ This program demonstrates the TimeStampToDateTime function }
Uses sysutils;
Var TS : TTimeStamp;
    DT : TDateTime;
Begin
  TS:=DateTimeToTimeStamp (Now);
  With TS do
    begin
    Writeln ('Now is ',time,' millisecond past midnight');
    Writeln ('Today is ' ,Date,' days past 1/1/0001');
    end;
  DT:=TimeStampToDateTime(TS);
  Writeln ('Together this is : ',DateTimeToStr(DT));
End.