From Clomosy Docs

(Created page with " function EncodeTime(const Hour, Min, Sec, MSec Word):TclDateTime; The EncodeTime function generates a TclDateTime return value from the passed Hour, Min, Sec and MSec (millisecond) values.<br> The permitted parameter values are :<br> Hour = 0..23<br> Min = 0..59<br> Sec = 0..59<br> MSec = 0..999<br> '''Example:'''<br> '''var''' myDate : TclDateTime;<br> '''begin''' // Set my date variable using the EncodeTime function myDate := '''EncodeTime'''(12, 50...")
 
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
function EncodeTime(const Hour, Min, Sec, MSec Word):TclDateTime;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function EncodeTime(Hour, Min, Sec, MSec: Word):TclDateTime;
</div>


The EncodeTime function generates a TclDateTime return value from the passed Hour, Min, Sec and MSec (millisecond) values.<br>  
The EncodeTime function generates a TclDateTime return value from the passed Hour, Min, Sec and MSec (millisecond) values.<br>  
Line 8: Line 10:
MSec = 0..999<br>
MSec = 0..999<br>


'''Example:'''<br>
<b>Example</b><br>
<pre>
var
  myDate : TclDateTime;
{
  // Set my date variable using the EncodeTime function
  myDate = EncodeTime(12, 50, 40, 231);
  ShowMessage('Date set to '+TimeToStr(myDate));
}
</pre>


'''var'''
<b>Output:</b><br>
  myDate : TclDateTime;<br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
'''begin'''
Time set to 12:50:40
  // Set my date variable using the EncodeTime function
</div>
  myDate := '''EncodeTime'''(12, 50, 40, 231);
  ShowMessage('Date set to '+'''TimeToStr'''(myDate));
'''end;'''


'''Output:'''<br>
<h2> See Also </h2>
Time set to 12:50:40
* [[System_Library#Date_and_Time_Functions | Date and Time Functions]]
{{#seo:|title=EncodeTime in Clomosy - Clomosy Docs}}
{{#seo:|description=Efficiently convert hours, minutes, seconds and milliseconds into a single time format for streamlined data processing with EncodeTime in Clomosy.}}

Latest revision as of 13:09, 24 December 2024

The EncodeTime function generates a TclDateTime return value from the passed Hour, Min, Sec and MSec (millisecond) values.
The permitted parameter values are :
Hour = 0..23
Min = 0..59
Sec = 0..59
MSec = 0..999

Example

 var
   myDate : TclDateTime;
 
 {
   // Set my date variable using the EncodeTime function
   myDate = EncodeTime(12, 50, 40, 231);
   ShowMessage('Date set to '+TimeToStr(myDate));
 }

Output:

See Also