#1
  1. meester luva luva
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Posts
    2,715
    Rep Power
    25

    changing time locale.....


    Ok,

    I am using

    <%
    Locale = Session.LCID
    Session.LCID = &H1033
    Response.Write FormatDateTime(Time)
    Session.LCID = Locale
    %>

    as I am hosted on a US server, but I need to display the time in GMT. This code still displays the server time though. Would it be better to just display <%=Time()%> and then knock 5 hours off the US time? If so, would <%Time(-5)%> work?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    How about

    Code:
    DateAdd("h",-5,Time)
    but as I always say Javascript is much better for ASP than VBScript

    Code:
    <script language="javascript" runat="server">
    var objDate = new Date();
    var d = objDate.toGMTString() 
    </script>
    --

    ngibsonau
  4. #3
  5. meester luva luva
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Posts
    2,715
    Rep Power
    25
    thankyou. That works good.

IMN logo majestic logo threadwatch logo seochat tools logo