Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Date Redirect-script
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Date Redirect-script

 Post Reply Post Reply Page  12>
Author
Kalle Kula View Drop Down
Newbie
Newbie
Avatar

Joined: 12 April 2004
Location: Sweden
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kalle Kula Quote  Post ReplyReply Direct Link To This Post Topic: Date Redirect-script
    Posted: 12 April 2004 at 5:38am

Hi All

Need help with a script that redirects the user to a page of the day e.g. events.asp?Date=4/12/2004

I have looket at a few scripts whitout success.
Redirect:

  1. Day of week
  2. Month


TIA
Björn Karlson

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 6:32am
<% Response.Redirect("events.asp?Date=" & Month(now) & "/" & Day(now) & "/" & year(now)) %>

Edited by Mart
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 9:07am
doesn't the date function return the date in the same format, but with less work? http://www.w3schools.com/vbscript/func_date.asp
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 9:52am
Nah, the date function returns the date and the time for some reason.
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: 12 April 2004 at 10:03am
I would pass the date across as a double number this would prevent corruption or date incompatibility problems eg:-

events.asp?Date<% = CDbl(Now()) %>

Then to convert the number back to a date in the events.asp file use:-

dtmDate = CDate(Request.QueryString("Date"))

VB and MS's databases store the underlying value of a date as a double number strating from 1899 for example todays date would be:-

12/04/2004 15.06 = 38089.6293634259
Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 10:15am

Not to mention the fact that usualy MS Access mistakes dates, especialy when the day number is smaller than 12, so a date like 3rd of April could be mistaken for 4th of march.

Especially since i've started to use mySQL which requires a special attention to dates I become very carefull and I always make sure which is month and which is day.

Cristian Banu
Soft 4 web
Back to Top
Kalle Kula View Drop Down
Newbie
Newbie
Avatar

Joined: 12 April 2004
Location: Sweden
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kalle Kula Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 10:18am

Hi

Thanks for all the quick responses.
Here is the page a want to use it on.

http://www.kocken.com/kalender

It´s in swedish but i think you get the hang of it.
Instead af the welcome screen i want the
events.asp?date=4/12/2004
to show up.

I think Mart´s solution is what i whant, being a newbie to ASP as i am.
<% Response.Redirect("events.asp?Date=" & Month(now) & "/" & Day(now) & "/" & year(now)) %>

Björn



Edited by Kalle Kula
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 12:44pm

Originally posted by Mart Mart wrote:

Nah, the date function returns the date and the time for some reason.

Actually... Response.Write(Date) returns just "4/12/04" on my server...

Back to Top
 Post Reply Post Reply Page  12>

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.