Subtract an hour from 'Time'

Results 1 to 4 of 4

Thread: Subtract an hour from 'Time'

  1. #1
    Corin Guest

    Default Subtract an hour from 'Time'

    I use the following code to get the time on a page:<BR><BR>Response.write ("<BR>&#060;font face=&#039Arial&#039 size=&#039 1&#039&#062;" & (Date) & " " & (Time) & " MST")<BR><BR>Unfortunatly my users are in Chicago and my server is in California so I get MST rather than CST. How can I subtract and hour from the time displayed?

  2. #2
    Corin Guest

    Default Reasonable answer, if you have better let me know

    Here&#039s what I am using if there is a better way let me know<BR><BR>Dim myTime <BR>myTime = Time - 0.0418<BR><BR>Response.write ("Some Stuff" & myTime & "Some more Stuff")<BR>

  3. #3
    Join Date
    Dec 1969

    Default Always local time?

    Will you always need the end-user&#039s local time/date on the page? If so, how about using JavaScript running in the browser instead? That&#039ll ensure you get their local time correct.<BR><BR>Adding/subtracting one hour (or more) on the server side will work only if you always know what timezone the user is in, and I can&#039t think of an easy way to determine that in an ASP. Your users are in Chicago, but what if they fly to New York with a laptop? Or, what if you move the server?

  4. #4
    Kenny Jones Guest

    Default RE: Subtract an hour from 'Time'

    DateAdd("h",-1,vDate)<BR><BR>"h" = hours. Can use "d" days, and other intervals (see help on DateAdd)<BR>

Posting Permissions

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