I’m making a page that displays some info in a table and I want that table to have a darker background on the entries from the night time.
I’m thinking of something like:
if ( ($timestamp < strtotime('2012-02-16 20:00:00') && ($timestamp > strtotime('2012-02-16 08:00:00') ){}
But I want this to function 24/7 all year. How do I make the date any date (* – * – *) ?
Not sure what format
$timestampis in, but if it’s in Unix timestamp format (epoch seconds), you could do this:If it’s not in Unix timestamp format, perhaps you could make it so in your query, using the
UNIX_TIMESTAMP()function.