LeoClock

What it is

LeoClock is a clean and simple but very functional clock module for Joomla. Unlike most Joomla module clocks I could find this does not use Javascript to get the time but instead does so through PHP which means mainly two things. First, everyone visiting the page will get the same time even if the clock on their computer is wrong as it uses the Server clock. Second, it has access to the handy timezone options in PHP, e.g "Europe/London" and "America/New_York".

The only drawback that I know of myself is that since the only time it actually gets the time is when the page loads and then keeps it ticking with Javascript, this means the clock might fall behind a few seconds if the browser were to lock up or be otherwise sluggish for a moment or, worse, mobile browsers where Javascript is suspended when you hold your finger on the screen or minimize the browser. However, since version 1.2.2 LeoClock will notice if any time has been missed due to any form of Javascript slowdowns and correct for this

The settings for the module are the following:

  • PHP Timezone.
  • Whether or not timezone should be showed below the clock.
  • Lets you choose if the displayed timezone should be complete with continent or just city. Either way it will format the original PHP timezone for nicer display. In addition you can choose to display a custom string in place of the standard timezones (added in version 1.2).
    • Europe/London shows as "Europe, London" if full and "London" if city.
    • America/New_York shows as "America, New York" if full and "New York" if city.
    • America/Indiana/Knox shows as "America, Indiana, Knox" if full and "Knox" if city.
    • Indian/Chagos shows as "Indian Ocean, Chagos" if full and "Chagos" if city.
  • Whether or not seconds should be displayed.
  • Time format, 24 or 12h.
  • Whether or not the current date should be displayed and if it it should, in what format. (Added in version 1.2.)

The module supports multiple instances running on the same page, just make sure you give the different names.

The module is available in Joomla 1.5 and Joomla 2.5 versions. The 2.5 version has been tested with Joomla 2.5 as well as 3.0 but it should work on any version above 1.6.

Why I created it

Put simply, because I wanted a clock that for my guild's website that fulfilled the two pros outlined above. I wanted everyone to see the same time and I wanted it to be for a specific timezone. At first it was just a .php page I hosted over here and used an iframe module on the guild site but I later decided to convert it into a proper Joomla module so it could run directly on the guild site and so that I could share it.

Demo

Want to see the module in action? Head over to the demo-page.

Version History

  • Version 1.2.4 - February 23 2013
    • Made the use of leading zeros optional. The option applies to the clock in both formats and the date where applicable.
  • Version 1.2.3a - February 21 2013
    • Hotfix - Small bug fix.
  • Version 1.2.3 - February 21 2013
    • Fixed a bug where the clock if set to 12h format would always show AM even if the current time was actually PM.
    • Added two additional date formats, 'MM/DD/YYYY' and 'Jan 16, 2013'.
  • Version 1.2.2 - February 01 2013
    • Add the option to specify your own string to be displayed in place of the Timezone.
    • Will now correct for missed seconds due to various forms of Javascript slowdowns/suspensions.
  • Version 1.2 - January 16 2013
    • Added date output with seven different formats.
  • Version 1.1.1 - January 10 2013 (only applies to the version for 2.5 and up)
    • Fixed a small issue which prevented Joomla 3.0 compatibility
  • Version 1.1 - October 31 2012
    • First public release

License

GNU GPL v3

Download

After updating from an earlier version you might need to open the settings page for any existing instances of the module and reapply the settings changed or not for the clock to work.

Latest version:

LeoClock 1.2.4 for Joomla 2.5 and up

LeoClock 1.2.4 for Joomla 1.5