Mega Code Archive

 
Categories / Delphi / Variables
 

Dateseparator - the character used to separate display date fields

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 DateTimeToStr Converts TDateTime date and time values to a string DateTimeToString Rich formatting of a TDateTime variable into a string DateToStr Converts a TDateTime date value to a string FormatDateTime Rich formatting of a TDateTime variable into a string TimeAMString Determines AM value in DateTimeToString procedure TimePMString Determines PM value in DateTimeToString procedure TimeSeparator The character used to separate display time fields 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