Converts a TDateTime date value to a string SysUtils unit
1  function DateToStr ( Date : TDateTime ) : string;
2  function DateToStr ( Date : TDateTime; const FormatSettings : TFormatSettings ) : string;
The DateToStr function converts a TDateTime value Date into a formatted date string.
The date is formatted using the ShortDateFormat value, which in turn uses the DateSeparator value.
Version 2 of this function is for use within threads. You furnish the FormatSettings record before invoking the call. It takes a local copy of global formatting variables that make the routine thread safe.
Related commands
DateSeparator The character used to separate display date fields
DateTimeToString Rich formatting of a TDateTime variable into a string
ShortDateFormat Compact version of the date to string format
TimeToStr Converts a TDateTime time value to a string
 Author links

 Buy Website Traffic at

 Buy Proxies at
 Download this web site as a Windows program.

Example code : Converting a date value to a string
  myDate : TDateTime;

  myDate := StrToDate('13/02/2002');
  ShowMessage('myDate = '+DateToStr(myDate));
Show full unit code
   myDate = 13/02/2002
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Home Page