gpt4 book ai didi

delphi - FormatSettings.ShortDateFormat 与系统区域设置不同

转载 作者:行者123 更新时间:2023-12-01 18:50:25 25 4
gpt4 key购买 nike

我通过执行以下操作获取当前格式设置:

 _FormatSettings := TFormatSettings.Create(GetThreadLocale);

我的系统短日期格式是dd.MM.yyyy,但_FormatSettings.shorDateFormatdd/MM/yyyy。我应该用 FormatSettings 日期分隔符替换斜杠还是我不知道其他内容?

我使用的是带有最新更新的 Windows 10。

我的实际短日期格式是:

Actual locale short date format

最佳答案

不,您不应替换 TFormatSettings.ShortDateFormat 中的斜杠。这可能会破坏日期的制定。

TFormatSettings.ShortDateFormat 中的“/”字符是实际日期分隔符的占位符 (TFormatSettings.DateSeparator),它将在制定日期字符串期间插入。

引用号。

procedure DateTimeToString(var 结果: string; const 格式: string;
日期时间:TDateTime; const AFormatSettings: TFormatSettings);

在 System.SysUtils 中

关于delphi - FormatSettings.ShortDateFormat 与系统区域设置不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60870805/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com