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 TFormatSettingsShortDateFormat 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'