From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
function DateToStr(Date TclDateTime):string;
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
The DateToStr function converts a DateTime value to a formatted date string.
function DateToStr(const DateTime: TclDateTime):string;
</div>
Converts a TclDateTime value into a string.<br>
Use DateToStr to obtain a string representation of a date value that can be used for display purposes.  


'''Example:'''<br>
<b>Example</b><br>
:'''Base Syntax'''
<b>TRObject Syntax</b><br>
<pre>
var
  myDate : TclDateTime;
{
  myDate = StrToDate('27.02.2023');
  ShowMessage('myDate = '+DateToStr(myDate));
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
  myDate : TclDateTime;


var
begin
  myDate : TclDateTime;<br>
  myDate := StrToDate('27.02.2023');
begin
  ShowMessage('myDate = '+DateToStr(myDate));
  myDate := StrToDate('27.02.2023');
end;
  ShowMessage('myDate = '+'''DateToStr'''(myDate));
</pre>
end;


:'''TRObject Syntax'''
<b>Output:</b><br>
<div class="alert alert-success" role="alert" data-bs-theme="light">
myDate = 27.02.2023
</div>


  var
<h2> See Also </h2>
    myDate : TclDateTime;
* [[System_Library#Type_Conversion_Functions | Type Conversion Functions]]
 
  {
    myDate = StrToDate('27.02.2023');
    ShowMessage('myDate = '+'''DateToStr'''(myDate));
  }
 
 
'''Output:'''<br>
myDate = 27.02.2023

Revision as of 10:05, 8 October 2024

Converts a TclDateTime value into a string.
Use DateToStr to obtain a string representation of a date value that can be used for display purposes.

Example
TRObject Syntax

var
  myDate : TclDateTime;
{
  myDate = StrToDate('27.02.2023');
  ShowMessage('myDate = '+DateToStr(myDate));
}

Base Syntax

var
  myDate : TclDateTime;

begin
  myDate := StrToDate('27.02.2023');
  ShowMessage('myDate = '+DateToStr(myDate));
end;

Output:

See Also