• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 691
  • Last Modified:

How to add +1 hour to time in ASP

Hi experts,
I'd like to display the time on my web page, but the web server is one hour behind. How could I add one hour to this?

<% Response.Write FormatDateTime(Time, vbShortTime) %>

Thanks for your help
0
baxtalo
Asked:
baxtalo
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
http://www.w3schools.com/vbscript/func_dateadd.asp
<% Response.Write FormatDateTime(dateadd("h",1,Time), vbShortTime) %>

however, the real thing is that you need to check is "why" is the Web servr 1 hour behind, resp is that "time" in regards to a given time band..
see: http://www.aspmessageboard.com/showthread.php?t=187399
0
 
Wayne BarronAuthor, Web DeveloperCommented:
Depends on where your webserver is located at.
The hosting company I am with, is I think an hour behind me, but fine for them.

Are you wanting to give the server time, or display the time of the user visiting?
0
 
baxtaloAuthor Commented:
Thank you very much; this is exactly what I needed.
The server time is correct, I just needed to add an hour because my users are one hour behind. The time is submitted through a web form.
0
 
baxtaloAuthor Commented:
Thank you carrzkiss, nice to see you. We were writing at the same time....
0
 
Wayne BarronAuthor, Web DeveloperCommented:
Hope you are doing good this new year Baxtalo.
Take care and keep coding!

Carrzkiss
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now