Converts a TDateTime time value to a string SysUtils unit
1  function TimeToStr ( Time : TDateTime ) : string;
2  function TimeToStr ( Time : TDateTime; const FormatSettings : TFormatSettings ) : string;
The TimeToStr function converts a TDateTime value Time into a formatted time string.
The time is formatted using the LongTimeFormat value, which in turn uses the TimeSeparator value.
Version 2 of this function is for use within threads. You furnish the FormatSettings record before invoking the call. It takes a local copy of global formatting variables that make the routine thread safe.
Related commands
DateTimeToStr Converts TDateTime date and time values to a string
DateToStr Converts a TDateTime date value to a string
LongTimeFormat Long version of the time to string format
TimeSeparator The character used to separate display time fields
 Author links

 Buy Website Traffic at

 Buy Proxies at
 Download this web site as a Windows program.

Example code : Converting a time value to a string
  myTime : TDateTime;

  myTime := StrToTime('15:22:35');
  ShowMessage('myTime = '+TimeToStr(myTime));
Show full unit code
   myTime = 15:22:35
Delphi Programming Neil Moffatt 2002 - 2018. All rights reserved.  |  Home Page