From Clomosy Docs
(Created page with " procedure DecodeTime(const SourceDateTime TclDateTime; out Hour, Min, Sec, MSec Word); The DecodeTime procedure extracts the hours, minutes, seconds, and milliseconds from a given TclDateTime type value.<br> It stores the values in output variables: Hour, Min, Sec and MSec. '''Example:'''<br> '''var''' myHour, myMin, mySec, myMilli : Word;<br> '''begin''' DecodeTime(Now, myHour, myMin, mySec, myMilli); ShowMessage('Time now = '+TimeToStr(Now)); Sh...") |
ClomosyAdmin (talk | contribs) No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert"> | |||
procedure DecodeTime(const DateTime: TclDateTime; var Hour, Min, Sec, MSec: Word); | |||
</div> | |||
The DecodeTime procedure extracts the hours, minutes, seconds, and milliseconds from a given TclDateTime type value.<br> | The DecodeTime procedure extracts the hours, minutes, seconds, and milliseconds from a given TclDateTime type value.<br> | ||
It stores the values in output variables: Hour, Min, Sec and MSec. | It stores the values in output variables: Hour, Min, Sec and MSec. | ||
<b>Example</b><br> | |||
<pre> | |||
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)); | |||
} | |||
</pre> | |||
<b>Output:</b><br> | |||
<div class="alert alert-success" role="alert" data-bs-theme="light"> | |||
Time Now = 16:02:07<br> | |||
Hour = 16<br> | |||
Minute = 2<br> | |||
Second = 7<br> | |||
MilliSec = 807 | |||
</div> | |||
<h2> See Also </h2> | |||
* [[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
procedure DecodeTime(const DateTime: TclDateTime; var Hour, Min, Sec, MSec: Word);
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:
Time Now = 16:02:07
Hour = 16
Minute = 2
Second = 7
MilliSec = 807