Skip to content

Instantly share code, notes, and snippets.

@igotit-anything
Last active September 5, 2016 15:35
Show Gist options
  • Save igotit-anything/d2297c86d6add2958a7af4015f887bd6 to your computer and use it in GitHub Desktop.
Save igotit-anything/d2297c86d6add2958a7af4015f887bd6 to your computer and use it in GitHub Desktop.
JavaScript. get utc time.
<script language="javascript">
function js_time()
{
var today = new Date();
return today.toUTCString();
}
</script>
// if in asp
<%
asp_utcTime = "<script>document.write(js_time());</script>"
%>
<%=asp_utcTime%>
//results
Mon, 05 Sep 2016 15:30:49 GMT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment