Icon DateTimeToStr

Unit: WebCore

Available In: Client and Server Applications

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

The DateTimeToStr function returns a formatted local or UTC date and time string for the DateTime input parameter. The format of the string is determined by the TFormatSettings ShortDateFormat and ShortTimeFormat properties. The return value is a String value.

Examples

A := StrToDateTime('2/13/2012 12:10 PM');
X := DateTimeToStr(A);  // X is '2/13/2012 12:10 PM'
Image