SQL 日期格式的 C-Sharp 日期时间文化格式
这种日期格式有文化吗?
2022-03-08 23:59:59
或者我是否必须使用 .ToString()
手动执行此操作?
Is there a culture for this date-format?
2022-03-08 23:59:59
Or do I have to do this manualy with .ToString()
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是否有一种文化可以确保
DateTime.ToString
输出这种格式,这很重要吗?重要的是您是否想以文化上合适的格式输出DateTime
。如果你不关心(给定的)文化,你为什么要要求它?如果您需要的只是
DateTime
作为该格式的字符串,请使用:Does it matter if there is a culture which ensures that
DateTime.ToString
will output this format? What matters is if you want to output aDateTime
in a culturally appropriate format or not. If you don't care about a (given) culture, why do you ask for it?If all you need is a
DateTime
as a string in that format, use: