Created
July 26, 2012 10:28
-
-
Save paulslugocki/3181391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page Language="C#" %> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<script runat="server"> | |
</script> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head runat="server"> | |
<title></title> | |
</head> | |
<body> | |
<form id="form1" runat="server"> | |
<div> | |
<% | |
// DateTime testing | |
String timeString = "dd/MMM/yyyy H:mm:ss"; | |
// Local time | |
DateTime testDateTime = DateTime.Now; | |
Response.Write(testDateTime.ToString(timeString + " z") + "<br>"); | |
// UTC time | |
DateTime testUtcDatetime = testDateTime.ToUniversalTime(); | |
Response.Write(testUtcDatetime.ToString(timeString) + "<br>"); | |
// Timestamp | |
TimeSpan span = (testUtcDatetime - new DateTime(1970, 1, 1, 0, 0, 0, 0)); | |
int stamp = (int)span.TotalSeconds; | |
Response.Write(stamp); | |
// End DateTime testing | |
%> | |
</div> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment