function StrToTimeDef(const Value: String; UTC: Boolean=False;
DefaultValue: DateTime=DateTime(0)): DateTime
The StrToTimeDef function converts the formatted local or UTC time string input parameter into its native value. The required format of the string is determined by the TFormatSettingsShortTimeFormat properties. If the input parameter is not a valid time string, the return value is the specified default value.
Examples
A := StrToTimeDef('12:10 PM', TimeToStr('12:00 AM'));
X := TimeToStr(A); // X is '12:10 PM'