Skip to content

Instantly share code, notes, and snippets.

@gareth-gillman
Last active July 17, 2018 19:18
Show Gist options
  • Save gareth-gillman/b2299e80740fef076b9ab32e0fb6ae48 to your computer and use it in GitHub Desktop.
Save gareth-gillman/b2299e80740fef076b9ab32e0fb6ae48 to your computer and use it in GitHub Desktop.
php check hours
<?php
$server_date = get_date();
$date = strtotime( $server_date );
$hour = date('H', $date);
if( $hour > 9 && $hour < 20 ) {
echo 'it's between 9am and 8pm';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment