|
-
Mar 8th, 2004, 12:12 PM
#1
Thread Starter
Member
How would YOU do this? *RESOLVED*
I would like to have a page that loads different data from a database based solely on what time of day it is. For instance, if it's between 11:00 AM and 1:00 PM, then DO THIS. Does anyone have any links or suggestions on working with time in ASP or ASP.Net? Thanks!
HWOODKY
Last edited by HollywoodKY; Mar 12th, 2004 at 12:16 AM.
-
Mar 8th, 2004, 06:08 PM
#2
PowerPoster
in your query do this:
WHERE MyDateTime BETWEEN(FirstDateTime, LastDateTime)
or something to that affect.
-
Mar 8th, 2004, 10:39 PM
#3
Thread Starter
Member
Actually, I'm wanting it to use the system time to determine what the page should display. If its between 12:00PM and 4:00PM, then display "this" page. The problem I'm running into is comparing the times and formulating an IF THEN statement. It would basically look like this:
On Page Load
If "System Time" > 11:59 AM AND < 4:01 PM Then
Load SampleSub
ElseIf "SystemTime" >4:00 PM AND < 10:01 PM Then
Load SampleSub2
End If
I'm pretty clueless as to how to formulate that statement... any ideas?
HWOODKY
-
Mar 9th, 2004, 07:55 AM
#4
VB Code:
IF now.hour >= 0 AND now.hour < 16 THEN
Load SampleSub
ELSEIF now.hour >= 16 AND now.hour < 22 THEN
Load SampleSub2
END IF
Is that what you need?
Now.minute, now.second,now.millisecond (and pretty much any other measure of time really) are also available if you need to narrow it down further. All return integer values.
Last edited by Fishcake; Mar 9th, 2004 at 08:25 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|