Einzelnen Beitrag anzeigen

Benutzerbild von Uwe Raabe
Uwe Raabe

Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.056 Beiträge
 
Delphi 12 Athens
 
#5

AW: TFormatSettings Unterschied ShortDateFormat und LongDateFormat

  Alt 6. Jul 2021, 10:26
Offenbar hatte ich die Frage falsch verstanden.

Die Kommentare in SysUtils helfen da aber weiter:
Zitat:
{ DateToStr converts the date part of the given TDateTime value to a string.
The conversion uses the format specified by the ShortDateFormat global
variable. }
Zitat:
{ TimeToStr converts the time part of the given TDateTime value to a string.
The conversion uses the format specified by the LongTimeFormat global
variable. }
Zitat:
{ DateTimeToStr converts the given date and time to a string. The resulting
string consists of a date and time formatted using the ShortDateFormat and
LongTimeFormat global variables. Time information is included in the
resulting string only if the fractional part of the given date and time
value is non-zero. }
Zitat:
{ StrToDate converts the given string to a date value. The string must
consist of two or three numbers, separated by the character defined by
the DateSeparator global variable. The order for month, day, and year is
determined by the ShortDateFormat global variable--possible combinations
are m/d/y, d/m/y, and y/m/d. If the string contains only two numbers, it
is interpreted as a date (m/d or d/m) in the current year. Year values
between 0 and 99 are assumed to be in the current century. If the given
string does not contain a valid date, an EConvertError exception is
raised. }
Zitat:
{ FormatDateTime formats the date-and-time value given by DateTime using the
format given by Format. The following format specifiers are supported:

c Displays the date using the format given by the ShortDateFormat
global variable, followed by the time using the format given by
the LongTimeFormat global variable. The time is not displayed if
the fractional part of the DateTime value is zero.
...
ddddd Displays the date using the format given by the ShortDateFormat
global variable.

dddddd Displays the date using the format given by the LongDateFormat
global variable.
Uwe Raabe
Certified Delphi Master Developer
Embarcadero MVP
Blog: The Art of Delphi Programming
  Mit Zitat antworten Zitat