Solved

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

Posted on 2011-09-13
3
330 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
  • 2
3 Comments
 
LVL 28

Accepted Solution

by:
sammySeltzer earned 500 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 28

Assisted Solution

by:sammySeltzer
sammySeltzer earned 500 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now