Results 1 to 2 of 2

Thread: Get utc time

  1. #1
    Join Date
    Dec 2006
    Location
    Basque Country
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Get utc time

    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!!!!!

  2. #2
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default RE:Get utc time

    <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>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •