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




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

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

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