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.
1.4m articles
1.4m replys
5 comments
57.0k users