I am developing a module, where:
- The administrator enters time in (0-23) format.These values gets saved in database.
- In the front end (for the website users) I need to fetch the current client time (not the server time), maybe using JavaScript, and then comparing it with the stored time (in PHP variables with current time fetched using JavaScript).
I want to do something like the following.
// $time_one: from the database.
// $time_two: from the database.
// $currentTime: client current time.
if (currentTime > $time_one && currentTime < $time_two) {
// Display some message.
}
How can this be done? Can PHP and JavaScript be mixed in the module file?