/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
double timestamp = 1113211532; // First make a System.DateTime equivalent to the UNIX Epoch. // Add the number of seconds in UNIX timestamp to be converted. dateTime = dateTime.AddSeconds(timestamp); // The dateTime now contains the right date/time so to format the string, // use the standard formatting methods of the DateTime object. string printDate = dateTime.ToShortDateString() +" "+ dateTime.ToShortTimeString();