LongDayNames - originally in SysUtils

delphi, delphi-xe, delphi-xe5

Solution

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.

Problem

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?

Original source