如何格式化SQL日期时间戳从BigInt到C#日期
我需要将SQL视图中的日期从bigint值(格式: 20220504112601755 )转换为c#日期时间值(到某种类似的格式: 2022.05.04 11:26:01 < /strong> )在C#中。
我发现的只是Unix Epoch Times,以及如何将其转换为可读的日期时间,但对我的问题的情况并不多。
任何帮助将不胜感激。 (没有包含任何代码,因为我什至没有尝试过的任何代码都无法按照我的意愿工作
)
I need to convert dates in an SQL view from BIGINT value (format: 20220504112601755) to C# date time value (to some similar format: 2022.05.04 11:26:01) within C#.
All I found were unix epoch times and how to convert those to readable date times but not much about my issue.
Any help would be appreciated. (Didn't include any code because nothing I tried even came close to working as I wanted)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用
datetime
parseexact
方法例如:You need to use the
DateTime
ParseExact
method e.g.: