DelphiBasics
TimeSeparator
Variable
The character used to separate display time fields SysUtils unit
var TimeSeparator : char;
Description
The TimeSeparator variable is used in date and time display functions between hour, minute and second values.
 
TimeSeparator value is ':' by default, depending on the Windows locale.
Notes
DateSeparator = LOCALE_STIME by default.
Related commands
DateSeparatorThe character used to separate display date fields
DateTimeToStringRich formatting of a TDateTime variable into a string
StrToTimeConverts a time string into a TDateTime value
TimeAMStringDetermines AM value in DateTimeToString procedure
TimePMStringDetermines PM value in DateTimeToString procedure
 Download this web site as a Windows program.




 
Example code : Changing the time display separator character
var
  mydate : TDateTime;

begin
  myDate := EndOfAMonth(2000, 2);// 29th Feb 2000 at 23:59:59.999

  LongTimeFormat := 'hh:mm:ss.zzz';  // Show milli-seconds

  ShowMessage('Date     = '+DateTimeToStr(myDate));
  TimeSeparator := '_';          // Override the : time separator
  ShowMessage('Date now = '+DateTimeToStr(myDate));
end;
Show full unit code
  Date = 29/02/2000 23:59:59.999
  Date now = 29/02/2000 23_59_59.999
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page