What do I put of code in the PHP-field to get a different css-file activated by night?

Comments

mrtoner’s picture

Something like this:

$hour = (int)date('G');
// After 7pm or before 4am.
if ($hour > 18 OR $hour < 4) {
  return TRUE;
}
else {
  return FALSE;
}

Edited 06/19/2010 to correct syntax errors.

jjjames’s picture

Hmm, can't get this to work...is it confirmed working?
Thanks!

mrtoner’s picture

It does when there aren't any syntax errors. :-/