gpt4 book ai didi

.net - Windows 应用商店应用程序的 .NET API 中的 DateTimeFormatInfo 中缺少 DateSeparator 和 TimeSeparator

转载 作者:行者123 更新时间:2023-12-02 12:22:27 25 4
gpt4 key购买 nike

在 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/

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