Moving from Delphi XE to XE5.
Label1.Caption:= 'Today''s day is '+LongDayNames[DayOfWeek(Date)];
'LongDayNames' no longer works. I see that Delphi put these in my uses:
System.SysUtils, System.Variants, System.Classes,
How do I find 'LongDayNames' so it works?
You use the values contained in the SysUtils.FormatSettings global variable:
Label1.Caption := SysUtils.FormatSettings.LongDayNames[DayOfWeek(Date)];
This allows them to be localized based on the current Windows locale.
Note that use of the global SysUtils.FormatSettings
is not thread-safe. To create a thread-safe copy of the format settings, create a local copy of TFormatSettings
using TFormatSettings.Create
as described in the documentation here instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With