From Clomosy Docs

(Created page with " function TimeToStr(Time TclDateTime):string; The TimeToStr function converts a TclDateTime value Time into a formatted time string. The time is formatted using the LongTimeFormat value, which in turn uses the TimeSeparator value.<br> '''Example:'''<br> '''var''' myTime : TclDateTime;<br> '''begin'''<br> myTime := StrToTime('15:22:35'); ShowMessage('myTime = '+TimeToStr(myTime));<br> '''end;''' '''Output:'''<br> myTime = 15:22:35")
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
function TimeToStr(Time TclDateTime):string;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
function TimeToStr(const S:TclDateTime):string;
</div>


The TimeToStr function converts a TclDateTime value Time into a formatted time string. The time is formatted using the LongTimeFormat value, which in turn uses the TimeSeparator value.<br>
The TimeToStr function converts a TclDateTime value S into a formatted time string. The time is formatted using the LongTimeFormat value, which in turn uses the TimeSeparator value.<br>


'''Example:'''<br>
<b>Example</b><br>
  '''var'''
<pre>
   myTime : TclDateTime;<br>
  var
  '''begin'''<br>
   myTime : TclDateTime;
   myTime := StrToTime('15:22:35');
   
   ShowMessage('myTime = '+TimeToStr(myTime));<br>
{
'''end;'''
   myTime = StrToTime('15:22:35');
   ShowMessage('myTime = '+TimeToStr(myTime));
}
</pre>


'''Output:'''<br>
<b>Output:</b><br>
myTime = 15:22:35
<div class="alert alert-success" role="alert" data-bs-theme="light">
myTime = 15:22:35
</div>
 
<h2> See Also </h2>
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
{{#seo:|title=TimeToStr Using in Clomosy - Clomosy Docs}}
{{#seo:|description=Convert TclDateTime values into formatted time strings with TimeToStr. Learn how to use this function with examples for efficient time handling!}}

Latest revision as of 14:06, 24 December 2024

The TimeToStr function converts a TclDateTime value S into a formatted time string. The time is formatted using the LongTimeFormat value, which in turn uses the TimeSeparator value.

Example

 var
   myTime : TclDateTime;
 
 {
   myTime = StrToTime('15:22:35');
   ShowMessage('myTime = '+TimeToStr(myTime));
 }

Output:

See Also