?
Solved

How to add one hour to server time in classic ASP?

Posted on 2011-09-13
3
Medium Priority
?
393 Views
Last Modified: 2012-05-12
Hi Experts,
I'm using the following to get the date and time on my web page:
<%=FormatDateTime(Date,1)%>&nbsp;<%=FormatDateTime(now,3)%>
My problem is that the server is in a different time zone and I need to add one hour to the time displayed on my page.
I'd appreciate your help.
0
Comment
Question by:baxtalo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 2000 total points
ID: 36533717
You can do this:

timevar = DateAdd("h",1,Time())

This adds one hour to time.

You can also use javascript to display date and time based on the time zone someone is on.

<script type="text/javascript">
   var dt = new Date('September 13, 2011 10:28 PM UTC');
   var formattedDateTime = dt.toLocaleString();
   document.write(formattedDateTime);
</script>

UTC determines your zone and toLocalString() function displays the date and time based on your time zone.

FInally, check this site out.

http://www.bullschmidt.com/devtip-timezones.asp

0
 
LVL 29

Assisted Solution

by:sammySeltzer
sammySeltzer earned 2000 total points
ID: 36533738
You could also try this:

DATEADD(hh,1,getdate())

or

<%
datevar = DATEADD("h",1,Now())
response.write datevar
%>

lots of options
0
 

Author Closing Comment

by:baxtalo
ID: 36533764
Thank you very much; this solved my problem.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question