如何将json响应日期字符串转换为c#日期格式?

我有像“1536476400000”这样的json字符串,我使用C#转换成“yyyy-MM-dd”格式。请帮我


繁花如伊
浏览 200回答 2
2回答

噜噜哒

已解决的答案是...String offset = "1536476400000";double spotQuoteEffDate = double.Parse(offset );TimeSpan spotQuoteEffDateTime = TimeSpan.FromMilliseconds(spotQuoteEffDate);DateTime spotQuote = new DateTime(1970, 1, 1) + spotQuoteEffDateTime;输出是...spotQuote = 9/9/2018 7:00:00 AM

万千封印

请参考下面的代码,  TimeSpan s = TimeSpan.FromMilliseconds(double.Parse("1536476400000" ));  DateTime dt = new DateTime(1970, 1, 1) + s;  Console.writeline(String.Format("{0:yyyy-MM-dd}",dt));
打开App,查看更多内容
随时随地看视频慕课网APP