Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I format time for time zones?

Status
Not open for further replies.

scripter73

Programmer
Apr 18, 2001
421
US
Hi,

I have a website that uses ASP to show the time. However, the server where my website's hosted uses Eastern Standard Time and I need Central Standard Time.

All I did in my code was use a <%=time%>. How can I format this for time zones?

Any help is appreciated.

Thanks,
scripter73
Change Your Thinking, Change Your Life.
 
Here is a simple script that just takes the number of hours off to account for the time zone.
dim one,two,three
one = (DatePart(&quot;H&quot;,Time())&chr(10))
one = one -1
two = Time()
two = Right(two,9)
three = formatDateTime(one&two)
Response.Write(three)

I hope that is what you were looking for
Roj
 
Hi yandso,

Excellent, excellent suggestion. I plugged it into my source code and now it works great! Thanks again for your great help.

scripter73
Change Your Thinking, Change Your Life.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top