Forum Discussion
validate current timestamp between given start and end date times
- 9 years ago
Don't worry dude we have another one way
Time Difference =
var Start_Date = NOW() -- Replace Now() with start_date
var end_Date = NOW() -- Replace Now() with end_datevar Start_time = FORMAT(Start_Date,"HH:mm:ss")
var End_time = FORMAT(end_Date,"HH:mm:ss")return FORMAT( TIME(LEFT(Start_time,2) ,MID(Start_time,4,2),RIGHT(Start_time,2)) -
TIME(LEFT(End_time,2) ,MID(End_time,4,2),RIGHT(End_time,2)) , "HH:mm:ss"
)I hope it will give u the time difference dude..
let me know any further doubts . cheers
Datediff (Startdate,Enddate,Day)
so use DateDiff function it will help u
- suji9 years agoAdvocate I
Hi Baskar,
Thanks for your quick response. Datediff will work for date compare. but my issue is Date with timestamp.
I have to check current timestamp is between given start date and end date.
Thanks & Regards,
Suresh Peddirsi
- Baskar9 years agoResident Rockstar
Don't worry dude we have another one way
Time Difference =
var Start_Date = NOW() -- Replace Now() with start_date
var end_Date = NOW() -- Replace Now() with end_datevar Start_time = FORMAT(Start_Date,"HH:mm:ss")
var End_time = FORMAT(end_Date,"HH:mm:ss")return FORMAT( TIME(LEFT(Start_time,2) ,MID(Start_time,4,2),RIGHT(Start_time,2)) -
TIME(LEFT(End_time,2) ,MID(End_time,4,2),RIGHT(End_time,2)) , "HH:mm:ss"
)I hope it will give u the time difference dude..
let me know any further doubts . cheers
- suji9 years agoAdvocate I
Thanks Baskar