FormatDateTime does not use system locale settings by default
Original Reporter info from Mantis: Buttercup5000
-
Reporter name: Will B
Original Reporter info from Mantis: Buttercup5000
- Reporter name: Will B
Description:
On a Linux system with locale set as en_us, FormatDateTime using the 'f' formatting literal produces: Now : 20-8-20 13:12:02. This is not the appropriate format for us_en. It should produce: Now: 08-20-2020 13:12:02 or something similar.
Steps to reproduce:
This code produces: Now : 20-8-20 13:12:02
&LtPos;code pascal>
Uses sysutils;
Begin
Writeln ('Now : ', FormatDateTime('f', Now()));
End.
&LtPos;/code>
However, if you add 'clocale' to the Uses clause, the code produces a more appropriate: Now : 08/20/2020 01:22:18 PM for the en_us locale.
Additional information:
The documentation page for FormatDateTime does not mention the need to use 'clocale' for locale-appropriate output, nor is there a Wiki page that mentions this.
Mantis conversion info:
- Mantis ID: 37610
- OS: Linux Mint
- OS Build: Ulyana
- Build: 2020/07/07
- Platform: Linux amd64
- Version: 3.2.0
- Fixed in version: 3.3.1
- Fixed in revision: 1737 (#b2778b41)
- Monitored by: » Buttercup5000 (Will B)
- Target version: 3.2.2