ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 26th, 2000, 01:08 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Time() and days

<i><b>Originally posted by : Kev (kev_1w@yahoo.co.uk)</b></i><br /><br />I need to determine if the current date is between two specified dates (from a database, in the format 14:14).<br />The dates are restaurant opening and closing times...<br />The problem Ive got is when one of the restaurants closes the following day, ie.<br /> Rs("Friday_Open")="11:00" and<br />Rs("Friday_Closed")="03:00"<br /><br />The restaurant opens at 11 o'clock and closes the following day, at three o'clock in the morning...<br /><br />This means that the current time ( Time() ) is not between these two values<br /><br />I tried the following.....<br /><br />normClose = CDate(Rs("Friday_Closed"))<br /> If normClose >= CDate("00:00") then<br /> normClose = DateAdd("d", 1, normClose)<br /> End If<br /><br />..... with no success!<br /><br />Any help would be much appreciated!<br /><br />Kev.<br />

Reply With Quote
  #2  
Old May 26th, 2000, 04:54 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : NesKen</b></i><br /><br /><br />Okay well in the second example you have<br /><br />normClose = CDate(Rs("Friday_Closed"))<br /> If normClose >= CDate("00:00") then<br /> normClose = DateAdd("d", 1, normClose)<br /> End If<br /><br />The second line NormClose >= 00:00...<br /><br />this will ALWAYS be true, how do you have a negative time???<br /><br />Proposed solution.<br /><br />if normclose <= CDate(rs("Friday_Open"))<br /><br />Now you know if it is less (If you are using military time which I assume you are.. if not let me know I will look back in a few minutes<br /><br /><br />------------<br />Kev at 5/26/2000 10:08:43 AM<br /><br /><br />I need to determine if the current date is between two specified dates (from a database, in the format 14:14).<br />The dates are restaurant opening and closing times...<br />The problem Ive got is when one of the restaurants closes the following day, ie.<br /> Rs("Friday_Open")="11:00" and<br />Rs("Friday_Closed")="03:00"<br /><br />The restaurant opens at 11 o'clock and closes the following day, at three o'clock in the morning...<br /><br />This means that the current time ( Time() ) is not between these two values<br /><br />I tried the following.....<br /><br />normClose = CDate(Rs("Friday_Closed"))<br /> If normClose >= CDate("00:00") then<br /> normClose = DateAdd("d", 1, normClose)<br /> End If<br /><br />..... with no success!<br /><br />Any help would be much appreciated!<br /><br />Kev.<br />

Reply With Quote
  #3  
Old May 26th, 2000, 08:49 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Kev (kev_1w@yahoo.co.uk)</b></i><br />Well, I was given the database full of restauraunt opening and closing times, which the client has entered...<br />For each restaurant I have an opening time and a closing time, I need to see if the restaurant is open at the time the visitor requests the page.<br />some restaurants open in the afternoon and dont close till three o'clock in the morning, so I have..<br />Rs("Friday_Open") <<< which is = 14:00 and<br />Rs("Friday_Closed") <<< which is = 03:00<br /><br />Rs("Friday_Closed") is = 03:00 on the same day<br /><br />I need to say...<br />-------------------------<br />If Time() >= Rs("Friday_Open") And Time() <= Rs("Friday_Closed") Then<br />---do something here--<br />End If<br />-------------------------<br /><br />It wont work because it is like saying the restaurant opens at 2 o'clock in the evening, but it closed at 3 o'clock that morning..<br /><br />I hope you follow!<br /><br />so I tried to add 1 day to this value if it was over 00:00 ....<br />Thats what this was for...<br />-------------------------<br /> If normClose >= CDate("00:00") then<br /> normClose = DateAdd("d", 1, normClose)<br /> End If<br />-------------------------<br /><br />A bit confusing, and its got me,<br /><br />Kev.<br /><br /><br />------------<br />NesKen at 5/26/2000 1:54:22 PM<br /><br /><br /><br />Okay well in the second example you have<br /><br />normClose = CDate(Rs("Friday_Closed"))<br /> If normClose >= CDate("00:00") then<br /> normClose = DateAdd("d", 1, normClose)<br /> End If<br /><br />The second line NormClose >= 00:00...<br /><br />this will ALWAYS be true, how do you have a negative time???<br /><br />Proposed solution.<br /><br />if normclose <= CDate(rs("Friday_Open"))<br /><br />Now you know if it is less (If you are using military time which I assume you are.. if not let me know I will look back in a few minutes<br /><br /><br />------------<br />Kev at 5/26/2000 10:08:43 AM<br /><br /><br />I need to determine if the current date is between two specified dates (from a database, in the format 14:14).<br />The dates are restaurant opening and closing times...<br />The problem Ive got is when one of the restaurants closes the following day, ie.<br /> Rs("Friday_Open")="11:00" and<br />Rs("Friday_Closed")="03:00"<br /><br />The restaurant opens at 11 o'clock and closes the following day, at three o'clock in the morning...<br /><br />This means that the current time ( Time() ) is not between these two values<br /><br />I tried the following.....<br /><br />normClose = CDate(Rs("Friday_Closed"))<br /> If normClose >= CDate("00:00") then<br /> normClose = DateAdd("d", 1, normClose)<br /> End If<br /><br />..... with no success!<br /><br />Any help would be much appreciated!<br /><br />Kev.<br />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Time() and days


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT