【问题标题】:UTC Timestamp in milliseconds to short datetime string in c#以毫秒为单位的 UTC 时间戳到 c# 中的短日期时间字符串
【发布时间】:2011-10-07 09:37:43
【问题描述】:

如何将 UTC timestamp 以毫秒为单位转换为 c# 中的短日期时间?

【问题讨论】:

标签: c# asp.net datetime timestamp utc


【解决方案1】:
DateTime UnixStartDate = new DateTime(1970, 1, 1);
YourDate = UnixStartDate.AddMilliseconds(YourTimestamp).ToShortDateString();

【讨论】:

  • 不要忘记第二行末尾的 .ToShortDateString() :)
猜你喜欢
  • 2016-07-07
  • 2011-05-31
  • 2016-09-06
  • 2016-06-05
  • 1970-01-01
  • 2022-03-21
  • 1970-01-01
  • 2015-09-15
  • 2018-01-10
相关资源
最近更新 更多