Delphi - Application independent of Regional Settings

给你一囗甜甜゛ 提交于 2019-12-03 20:49:47

Apply your own TFormatSettings record. Call FormatDateTime('aConstantDefined',ADateTime,myFormatSettings) when appropriate.

This will avoid mishaps if your application changes the system format settings. So you don't have to use Application.UpdateFormatSettings and Application.UpdateMetricSettings.

Update :

I should add that all format string functions involved with regional settings, takes the TFormatSettings overloaded parameter. It is often used to make the application thread-safe, but comes in handy when overriding regional settings. I often use this technique when serializing/deserializing data for communication/storing purposes.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!