From Clomosy Docs

(Created page with " function DateToStr(Date TDateTime):string; The DateToStr function converts a DateTime value to a formatted date string. '''Example:'''<br> begin ShowMessage('myDate = '+'''DateToStr'''(Date)); end; '''Output:'''<br> myDate = 27.02.2023")
 
No edit summary
Line 1: Line 1:
  function DateToStr(Date TDateTime):string;
  function DateToStr(Date TclDateTime):string;
The DateToStr function converts a DateTime value to a formatted date string.
The DateToStr function converts a DateTime value to a formatted date string.


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


'''Output:'''<br>
'''Output:'''<br>
  myDate = 27.02.2023
  myDate = 27.02.2023

Revision as of 12:17, 27 February 2023

function DateToStr(Date TclDateTime):string;

The DateToStr function converts a DateTime value to a formatted date string.

Example:

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

Output:

myDate = 27.02.2023