View Full Version : Get utc time
mahoni
01-25-2007, 08:29 AM
Hello!
I would want to get utc time in Asp.
I know how to do it with javascript, but i need it in asp.
Thanks!!!!!
mukesh
02-22-2007, 05:06 AM
<script language="JScript" runat="server">
function GetUnixTime(strDate) {
if (strDate) {
return new Date(strDate).valueOf();
}
else {
return 0;
}
}
var serverdate=new Date();
</script>
This script will provide the server time and UTC time .
<html>
<body>
<p>
This timestamp for the UTC time
<%=GetUnixTime(serverdate.toUTCString())
%>
<br>
this UTC time
<%=serverdate.toUTCString()%>
</p>
</body>
</html>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.