Icon DateToStr

Unit: WebCore

Available In: Client and Server Applications

function DateToStr(Value: DateTime; UTC: Boolean=False): String;

The DateToStr function returns a formatted local or UTC date string for the DateTime input parameter. The format of the string is determined by the TFormatSettings ShortDateFormat property. The return value is a String value.

Examples

A := StrToDateTime('2/13/2012');
X := DateToStr(A);  // X is '2/13/2012'
Image