Sign in Join
FPDoc Onlineexperiment

DateToStr function

In unit sysutils

Converts a TDateTime value to a date string with a predefined format.

Declaration

pascal
function DateToStr(Date: TDateTime): string

Description

DateToStr converts Date to a string representation. It uses ShortDateFormat as it's formatting string. It is hence completely equivalent to a FormatDateTime('ddddd', Date).

Note that on unix systems, the localization support must be enabled explicitly, see Localization.

Errors

None.

See also

Example: ex7

pascal
Program Example7;

{ This program demonstrates the DateToStr function }

Uses sysutils;

Begin
  Writeln(Format ('Today is: %s',[DateToStr(Date)]));
End.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.