Web Wiz - Green Windows Web Hosting - Celebrating 25 Years!

  New Posts New Posts RSS Feed - Time Offset
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Time Offset

 Post Reply Post Reply
Author
seanlail View Drop Down
Groupie
Groupie


Joined: 01 December 2004
Location: United Kingdom
Status: Offline
Points: 101
Post Options Post Options   Thanks (0) Thanks(0)   Quote seanlail Quote  Post ReplyReply Direct Link To This Post Topic: Time Offset
    Posted: 06 December 2005 at 4:11pm
Hi all,

I am having a weird issue.

In the "Forum Preferences" (register.asp) there is a present server date and time and the user has the ability to offset this to his local time.

My problem is:

No matter where in the world my users are... they all see that the server time is exactly the same as theirs...

How can this be???
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 07 December 2005 at 4:38am
Because the time is that of the web server, which remains in the same place ni matter where the user is who connects to the server.

In ASP there is noway to get UNC or GMT time, so the only place to get the time from is the web server. The time on the web server remains the same no matter where the user connects to the server from.
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 07 December 2005 at 5:44pm
You can use JScript to get the time in GMT.


<script runat="server" language="jscript">
     function getGMTTime()
     {       
     var d, s;
     d = new Date();
     s = d.toUTCString();
     return(s);
     }
</script>
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2005 at 9:41am
Yes, but the forum uses VbScript not JScript
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2005 at 11:00pm
However, your statement was
Quote In ASP there is noway to get UNC or GMT time

which is patently untrue.

Any ASP page can use both JScript and VBScript. If you use VBScript as your main language you just have to use the synatax sbove outside your script delimiters and you should be able to call the JScript function from within your application.

I use VBScript and this is what I use when I need the time in GMT. If you check out www.warmageddon.com you'll see that it displays the time in GMT (at the bottom of the page). That site is written in VBScript except for this one function.

The time in GMT can also be called via MSSQL by using the getUTCdate() function but that doesn't work in Access.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2005 at 6:48am
OK, I'll give it a go
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.