The hard part of this is getting the users time, and this could depend on timezone, DST etc.
The only way I have found this possible is using JS to get browser information and then compare it with the server output. You will have to pass the server output to the DOM or use AJAX to make the communication with the server.
Bit of a challenge, I was doing this for a listing site for displaying opening hours and notifying the users if the business was open, I have put it on the back burner for now.