From Clomosy Docs

No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 8: Line 8:


<b>Example</b><br>
<b>Example</b><br>
<b>TRObject Syntax</b><br>
 
<pre>
<pre>
var
var
Line 21: Line 21:
   ShowMessage('MilliSec = '+IntToStr(myMilli));
   ShowMessage('MilliSec = '+IntToStr(myMilli));
}
}
</pre>
<b>Base Syntax</b><br>
<pre>
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;
</pre>
</pre>


Line 48: Line 34:
<h2> See Also </h2>
<h2> See Also </h2>
* [[System_Library#Date_and_Time_Functions | Date and Time Functions]]
* [[System_Library#Date_and_Time_Functions | Date and Time Functions]]
{{#seo:|title=DecodeTime Using in Clomosy - Clomosy Docs}}
{{#seo:|description=DecodeTime extracts hours, minutes, seconds, and milliseconds from a TclDateTime value and stores them in specified variables for easy time manipulation.}}

Latest revision as of 14:01, 24 December 2024

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

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));
}

Output:

See Also