Print Page | Close Window

Date Redirect-script

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=9957
Printed Date: 31 March 2026 at 4:32pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Date Redirect-script
Posted By: Kalle Kula
Subject: Date Redirect-script
Date 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




Replies:
Posted By: Mart
Date Posted: 12 April 2004 at 6:32am
<% Response.Redirect("events.asp?Date=" & Month(now) & "/" & Day(now) & "/" & year(now)) %>


Posted By: KCWebMonkey
Date 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 - http://www.w3schools.com/vbscript/func_date.asp


Posted By: Mart
Date Posted: 12 April 2004 at 9:52am
Nah, the date function returns the date and the time for some reason.


Posted By: WebWiz-Bruce
Date 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

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: zaboss
Date 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
http://www.soft4web.ro - Soft 4 web


Posted By: Kalle Kula
Date 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 - 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



Posted By: KCWebMonkey
Date 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...



Posted By: Mart
Date Posted: 12 April 2004 at 3:10pm
Oh, on asptutorial.info where I looked up it said date return the time and date.


Posted By: michael
Date Posted: 12 April 2004 at 5:05pm
nah now() returns everything time() returns time, date() returns date hence their names.

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


Posted By: Mart
Date Posted: 12 April 2004 at 5:35pm
Doh


Posted By: Kalle Kula
Date Posted: 15 April 2004 at 1:40pm

Thanks All for your engagement.

It works like a charm at http://www.kocken.com/kalender - http://www.kocken.com/kalender  
I understand that my webhotel is not in Sweden (ActiveISP)

Now that remains is filling the calendar with info Chef´s and Cooks are interested in.

Thanks again, especially Mart
Björn

PS.
Sinse Microsoft terminated the MVP-project i have not came across this engagement.
DS.




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