BrighteyesDesign
asked on
Show'Hode content depending on time - Hours & minutes
Thanks to the wonderful Ray Paseur I have a script working which hides content if it's after one o'clock.
<?php if (date('H') < 13) : ?>
What I need to do now is change this to 1.30. Any ideas how i would change the code below to do this?
I've tried <?php if (date('H') < 13.30) : ?> & <?php if (date('H') < 13.5) : ?> with no joy...
<?php if (date('H') < 13) : ?>
What I need to do now is change this to 1.30. Any ideas how i would change the code below to do this?
I've tried <?php if (date('H') < 13.30) : ?> & <?php if (date('H') < 13.5) : ?> with no joy...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try this... untested but probably OK in principle.
<?php if (date('H:i') < '13:30') : ?>
Ref: https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
<?php if (date('H:i') < '13:30') : ?>
Ref: https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
Open in new window