[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-09-13
3
Medium Priority
?
402 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

649 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