Posted By

sdxxx on 03/21/11


Tagged

css


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

sdxxx


Change CSS according to Timezone-specific Date


 / Published in: PHP
 

URL: http://wordpress.org/support/topic/change-css-according-to-date

Date format guide:

d = 01 to 12 ; m = 01 to 12 ;

More formats: http://php.net/manual/en/function.date.php

  1. <?php
  2.  
  3. date_default_timezone_set('Asia/Hong_Kong');
  4.  
  5. if( date('d m') == '01 04' ) {
  6. echo '<link rel="stylesheet" href="style.css" type="text/css" media="screen" />';
  7. } else {
  8. echo '<link rel="stylesheet" href="style_2.css" type="text/css" media="screen" />';
  9. }
  10.  
  11. ?>

Report this snippet  

You need to login to post a comment.