0
How do I set regional date, time, decimal separator, mile separator settings in Delphi 10 Tokyo? Previously, in Delphi 7, there were global system variables. In newer versions they created the record TFormatSettings
, but apparently there’s no effect on the changes I’m making.
Example: I am running my program on a PC where the local date and time are in American format, i.e., 'MM/DD/YYYY h:mm:ss AM/PM' (inverted month and 12 hours + AM/PM). I want my application to be in the Brazilian standard, i.e., "DD/MM/YYYY HH:mm:ss" (24 hours).
How to apply this change to my local settings using TFormatSettings
?
Thank you Matheus. However, in older versions of Delphi, once set the global settings it was no longer necessary to pass my custom formatting to anything, as you showed in your
DateToStr(Data, VariavelFormatSettings)
. This is no longer possible in current versions of Delphi?– wBB
Of course, it is possible yes, just use the global variable of Delphi
FormatSettings
she belongs toSystem.SysUtils
. So you could do more or less like this, for example,FormatSettings.DateSeparator
– Matheus Ribeiro
You’re really right. I was trying to create the variable and just set the record
TFormatSettings
directly without creating anything. Thank you!– wBB