- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我通过执行以下操作获取当前格式设置:
_FormatSettings := TFormatSettings.Create(GetThreadLocale);
我的系统短日期格式是dd.MM.yyyy
,但_FormatSettings.shorDateFormat
是dd/MM/yyyy
。我应该用 FormatSettings
日期分隔符替换斜杠还是我不知道其他内容?
我使用的是带有最新更新的 Windows 10。
我的实际短日期格式是:
最佳答案
不,您不应替换 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/
在尝试在 XE4 中编译 Log4D 时,我看到 [dcc32 Error] Log4D.pas(2139): E2003 Undeclared identifier: 'ShortDateForma
我意识到 ShortDateFormat 变量代表用户的偏好。 我还意识到,如果设置发生更改,Delphi 将使用用户的设置自动刷新 ShortDateFormat 变量。 mm/dd/yy 我有一位
我通过执行以下操作获取当前格式设置: _FormatSettings := TFormatSettings.Create(GetThreadLocale); 我的系统短日期格式是dd.MM.yyyy
我是一名优秀的程序员,十分优秀!