Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Two questions about time.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Two questions about time.

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

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Topic: Two questions about time.
    Posted: 16 August 2003 at 1:33pm

I have two questions about time...

1. <%= time %> Does this dispaly the server time, or the local time for the viewer?

2. How do I edit time? I have noticed <%= time+1 %> and similare scripts don't work. I keep geeting this "12/31/1899 3:37:19 PM" (how did it come up with that?).

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: 16 August 2003 at 5:08pm
1. It does display the server time, asp is always server.
2. If you display time it does not have a date associated with it. So if you add the date 1 to the time 1 it start "at the beginning of time" Well Stephen Hawking says it was when the big bang occured, Bill Gates said it was December 30, 1899. So if you add 1 to that you get Sunday, December 31, 1899. If you want to calculate with times you need to actually get the server date. You can do that with something like now() and now() + 1 would equal tomorrow that same time. Now that is not a very nice way of doing it cause you may want to add or substract minutes, hours, weeks or years. For that you can use the datepart function so i.e. now() + datepart("y",1) would add a year to the current time. 
Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2003 at 5:08pm

1. It displays the server time.

2. Use the DateAdd function to edit the time. See http://www.w3schools.com/vbscript/func_dateadd.asp for details on how to use it.

Edit: Just beat me to it Michael!

Blair



Edited by b_bonnett
Webmaster, The Plane Gallery
Greetings From Christchurch
Back to Top
Aumuz View Drop Down
Groupie
Groupie
Avatar

Joined: 14 March 2003
Location: United States
Status: Offline
Points: 43
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aumuz Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2003 at 7:06pm

I figured it out (forgot to edit my post)...

<%= time+.001 %> will offset the time min... <%= time+.01 %> ten min... <%= time+.1 %> one hour and so on.

But thanks for your help.

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.