Print Page | Close Window

GMT

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5837
Printed Date: 30 March 2026 at 11:40pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: GMT
Posted By: cuedog
Subject: GMT
Date Posted: 18 September 2003 at 11:02pm
I am trying to make a time zone script. I am not quite understanding the GMT time zone operations. I know it means Greenwich Mean Time. I have a database with all the time zones from +12 to -12. Is GMT a function like GMT()? I know I could use the DateAdd function
dtTimeZone = DateAdd(hh, -12, Now())

The only thing is I live in the Central Time Zone and my webhost is in the Pacific Time zone which will throw off the time, it seems to me. There is a 2 hour difference between where I live and my webhost location. For the time zone in the database for the central time zone it says -6. I'm confused
Can someone set me straight?


-------------
http://www.512ryders.com - 512 Ryders



Replies:
Posted By: wistex
Date Posted: 18 September 2003 at 11:20pm

The -6 refers to how many hours you need to subtract from Greenwich Mean Time (GMT) / Coordinated Universal Time (UTC) to get Central Standard Time (CST).

If it is 7 p.m. GMT, you would subtract 6 hours to get 1 p.m. Central Standard Time.

Central Standard Time is -6 UTC.
Central Daylight Savings Time is -5 UTC.

Don't forget about Daylight Savings when doing your math!  That will throw you off an hour.



-------------
http://www.wistex.com" rel="nofollow - WisTex Solutions
http://www.caribbeanchoice.com/forums" rel="nofollow - CaribbeanChoice Forums


Posted By: michael
Date Posted: 19 September 2003 at 9:38am
If you have a SQL2000 running you can run a function called GETUTCDATE() which returns the GMT time. If you are running SQL7 you need to create a SP to mimic that.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: cuedog
Date Posted: 19 September 2003 at 10:01pm
I am running MySQL Server. Is there any code in vbscript to use
Greenwich Mean Time (GMT) / Coordinated Universal Time (UTC) ?


-------------
http://www.512ryders.com - 512 Ryders


Posted By: michael
Date Posted: 19 September 2003 at 10:47pm

I am not sure with pure vbscript but a mix of jscript and vbscript should get you on the way

<%@ LANGUAGE="VBSCRIPT" %>

<script language="JavaScript" runat="server">
function GMTime() {
return new Date().toGMTString(); }
</script>


<html>
<body>
<% Dim GMT
GMT = GMTime()
Response.Write GMT %>

</body>
</html>



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net