How to add "Clock" widget to the blog demo

OK, I have found another solution making use of non domestic clock.

Posted Image

  • Copy following code and save as blog/protected/components/Clock.php.



class Clock extends Portlet


        public $title='Clock';

        protected function renderContent()





  • Copy following code and save as blog/protected/components/views/clock.php.


<embed src=""

  width="140" height="140" wmode="transparent" type="application/x-shockwave-flash">


> Note. You may want to change the timezone from JST to whatever.

  • Add following line to blog/protected/views/layouts/main.php.


    <?php $this->widget('Recent Comment'); ?>

+    <?php $this->widget('Clock'); ?>

Terms & Conditions:

I am using the world clock from, thus the user should obey the terms and conditions of this site, though it is free of charge.

Have fun ;)

[Updated: Feb 22, 2009]

Collection of the enhancements:…gdemo-enhanced/