From Clomosy Docs

Revision as of 08:14, 8 October 2024 by ClomosyManager (talk | contribs)

The DecodeTime procedure extracts the hours, minutes, seconds, and milliseconds from a given TclDateTime type value.

It stores the values ​​in output variables: Hour, Min, Sec and MSec.

Example
TRObject Syntax

var
  myHour, myMin, mySec, myMilli : Word;

{
  DecodeTime(Now, myHour, myMin, mySec, myMilli);
  ShowMessage('Time now = '+TimeToStr(Now));
  ShowMessage('Hour     = '+IntToStr(myHour));
  ShowMessage('Minute   = '+IntToStr(myMin));
  ShowMessage('Second   = '+IntToStr(mySec));
  ShowMessage('MilliSec = '+IntToStr(myMilli));
}

Base Syntax

var
  myHour, myMin, mySec, myMilli : Word;

begin
  DecodeTime(Now, myHour, myMin, mySec, myMilli);
  ShowMessage('Time now = '+TimeToStr(Now));
  ShowMessage('Hour     = '+IntToStr(myHour));
  ShowMessage('Minute   = '+IntToStr(myMin));
  ShowMessage('Second   = '+IntToStr(mySec));
  ShowMessage('MilliSec = '+IntToStr(myMilli));
end;

Output:

See Also