Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - GMT
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GMT

 Post Reply Post Reply
Author
cuedog View Drop Down
Groupie
Groupie
Avatar

Joined: 29 December 2001
Location: United States
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuedog Quote  Post ReplyReply Direct Link To This Post Topic: GMT
    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?
Back to Top
wistex View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
Post Options Post Options   Thanks (0) Thanks(0)   Quote wistex Quote  Post ReplyReply Direct Link To This Post 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.



Edited by wistex
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
cuedog View Drop Down
Groupie
Groupie
Avatar

Joined: 29 December 2001
Location: United States
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote cuedog Quote  Post ReplyReply Direct Link To This Post 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) ?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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>

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.