The processing of date formats is always complex, because different environment date formats are not the same. In order to process the unified processing, it is best to unify the format:
Can be in the initialization section of the program:
' dd/mm/yyyy ' ; Formatsettings.dateseparator:'/'; for 1 to A Do system.sysutils.formatsettings.shortmonthnames[i]:= snames[i];
Where Snames is the global array of its own defined month name, if you display the format for example: ' dd MMM yyyy ' that ' mmm ' displays the corresponding string in this array, the definition can be:
ConstSnames:Array[1.. A] of string= ('Jan','Feb','Mar','APR',' May','June','Jul',' the','Sep','Oct','Nov','Dec');
Explanation of some attributes in Tformatsettings:
Dateseparator:char Date separator, used to separate month and day
Timeseparator:char time separator, for separating hours, minutes, seconds
Shortdateformat:string the definition of the short date format in the regional settings.
Longdateformat:string the definition of the long date format in the regional settings.
Shorttimeformat:string the definition of a short time format in a locale.
Longtimeformat:string the definition of the long-time format in the regional settings.
Timeamstring:string used to represent the morning string
Timepmstring:string used to represent the afternoon string
SHORTMONTHNAMES:ARRAY[1..12] of String; An array for the abbreviated name of the month, which is the string of the MMM identity that is displayed when using FormatDateTime
LONGMONTHNAMES:ARRAY[1..12] of String; An array that is used to fully represent the name of the month, which is the mmmm identity string that is displayed when using FormatDateTime
SHORTDAYNAMES:ARRAY[1..7] of String; An array that is used to indicate the name of the day of the week, which is the DDD identity string that is displayed when using FormatDateTime
LONGDAYNAMES:ARRAY[1..7] of String; An array that is used to fully represent the name of the day, which is the string of DDD identities that are displayed when using FormatDateTime
Twodigityearcenturywindow:word = 50; The starting year when the two-bit year is used.
How to treat the date format uniformly in Delphi Xe, play turn Tdatetime