作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Windows 应用商店应用程序的 .NET API 中 DateTimeFormatInfo 不包含以下属性日期分隔符和时间分隔符。原因可能是两者都允许在完整 API 中进行设置。但如果我需要获取当前日期或时间分隔符(我确实这样做了),我可以使用什么来代替?
最佳答案
您可以使用DateTime format strings获取信息。
var dateSep = DateTime.Now.ToString("%/", dateTimeFormatInfo);
var timeSep = DateTime.Now.ToString("%:", dateTimeFormatInfo);
关于.net - Windows 应用商店应用程序的 .NET API 中的 DateTimeFormatInfo 中缺少 DateSeparator 和 TimeSeparator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12475413/
我希望根据系统的格式设置获取日期分隔符。在 Delphi 中,我正在使用 System.SysUtils.TFormatSettings.DateSeparator,在 C 中有类似的东西吗? 最佳答
这个问题已经有答案了: DecimalSeparator in SysUtils and System.SysUtils (2 个回答) 已关闭 9 年前。 我有一个用Delphi 5创建的程序,该程
在 Windows 应用商店应用程序的 .NET API 中 DateTimeFormatInfo 不包含以下属性日期分隔符和时间分隔符。原因可能是两者都允许在完整 API 中进行设置。但如果我需要获
我是一名优秀的程序员,十分优秀!