|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
How to compare time
This is my the part of the code in asp in which i want that if record is getting submitted between morning 6 am to night 12 pm
the value of sdate should be current date or if the time is between night 12 to morning 6 the value of sdate should be the previous date but this comparison is not working please help me. if (time()>"06:00:00 AM") and (time()<"07:00:00 AM") then sdate = Year(Date()) & "-" & Month(Date()) & "-" & Day(Date()) Response.Write(sdate) End IF I am using MySQL as my backend Thanx in advance Rahul
__________________
Rahul Small things lead to perfection and perfection is not a small thing. |
|
#2
|
|||
|
|||
|
You might
want to have a look into the DateDiff() function and yes you can compare time, there is no TimeDiff() function...have a look here:
http://www.devguru.com/Technologies...f/datediff.html Also, you are comparing time() with a string that looks like a time value "06:00:00 AM" but in fact it is a string... try converting that *string* using Cdate() if (time()>CDate("06:00:00 AM")) and (time()<CDate("07:00:00 AM")) then . . . try that otherwise look into the DateDiff() function Hope this helps! Sincerely Vlince |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > How to compare time |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|