Skip to content
Advertisement

How to compare start and end time with current time in php?

JavaScript

In the above code. What happen now when start time and current time is equal or current time is greater then start time then it show start exam but it not working properly. So, How can I compare start and end time with current time? Please help.

Thank you

Advertisement

Answer

You need to initialize dates variables as DateTime and set the time. For example this

JavaScript

Here is a full playground https://tehplayground.com/O8vPv3ZExM4U7AtY

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement