From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function DateToStr(const DateTime: TDateTime): string;
function DateToStr(const DateTime: TDateTime; const AFormatSettings: TFormatSettings): string;


extern DELPHI_PACKAGE System::UnicodeString __fastcall DateToStr(const System::TDateTime DateTime)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


Converts a TDateTime value into a string.

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

The first form of DateToStr is not thread-safe, because it uses localization information contained in global variables. The second form of DateToStr, which is thread-safe, refers to localization information contained in the AFormatSettings parameter. Before calling the thread-safe form of DateToStr, you must populate AFormatSettings with localization information. To populate AFormatSettings with a set of default locale values, call TFormatSettings.Create.

See Also

Code Examples