From Clomosy Docs

No edit summary
No edit summary
 
(3 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>
:'''Base Syntax'''
<pre>
  var
var
    myDate : TclDateTime;
  myDate : TclDateTime;
 
  begin
{
    // Set my date variable using the EncodeTime function
  // Set my date variable using the EncodeTime function
    myDate := '''EncodeTime'''(12, 50, 40, 231);
  myDate = EncodeTime(12, 50, 40, 231);
    ShowMessage('Date set to '+TimeToStr(myDate));
  ShowMessage('Date set to '+TimeToStr(myDate));
  end;
}
</pre>


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


 
<h2> See Also </h2>
'''Output:'''<br>
* [[System_Library#Date_and_Time_Functions | Date and Time Functions]]
Time set to 12:50:40
{{#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