Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-03

Lazarus 2.0 returning inconsistent formatted results of DateTimeToStr?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Joe

The DateTimeToStr function returns somewhat inconsistent formatted results, depending on the operating system.

For "DateTimeToStr (now, DefaultFormatSettings)"

-  under Windows 10 (64), I got "12-03-2019 21:35:50" -  under Linux Mint Sarah, I got "12-3-19 21:35:50" -  under Raspbian Stretch, i got "12-3-19 21:35:50"

The Language Switch of the IDE, Tools -> Options ... -> General -> Language, was  set to "German [de]".

-- Joe

Reply by email

Michael Van Canneyt
to Joe
Joe wrote 11 lines
The DateTimeToStr function returns somewhat inconsistent formatted results, depending on the operating system. For "DateTimeToStr (now, DefaultFormatSettings)" -  under Windows 10 (64), I got "12-03-2019 21:35:50" -  under Linux Mint Sarah, I got "12-3-19 21:35:50" -  under Raspbian Stretch, i got "12-3-19 21:35:50" The Language Switch of the IDE, Tools -> Options ... -> General -> Language, was  set to "German [de]".

This is normal. The operating system settings are used, not the IDE language settings.

For Linux OS settings to be initialized correctly, you should add the 'clocale' unit to your program's uses clause.

Michael.

Reply by email