In C# how can I convert Unix-style timestamp to yyyy-MM-ddThh:mm:ssZ?
Start by converting your milliseconds to a TimeSpan:
TimeSpan
var time = TimeSpan.FromMilliseconds(milliseconds);
Now, in .NET 4 you can call .ToString() with a format string argument. See http://msdn.microsoft.com/en-us/library/system.timespan.tostring.aspx
.ToString()
In previous versions of .NET, you'll have to manually construct the formatted string from the TimeSpan's properties.
2.1m questions
2.1m answers
60 comments
57.0k users