Module v1.0.1 3rd Dec 2016  

SunClock is a novel clock. Rather than displaying the time since midnight, it displays the time since the last sunrise.

Midnight as the start point for timing a new day is a bit arbitrary and doesn't easily relate to anything you can simply detect in the real world. Notionally 12 hours after the sun reaches its zenith in the sky - you could determine midday using a sextant or similar instrument and start a timer to count 12 hours from then. But midnight itself is not something you can directly observe.

Much more natural to use sunrise as the defining point for the start of a new day and then count time from that point.

Of course you can define sunrise in different ways, but at least it is something you can directly observe.

One consequence of this is that the length of the day varies slightly throughout the year, during spring when the sun rises earlier each day the length of the day will be slightly less than 24 hrs, correspondingly during autumn it will be a few minutes more than 24 hrs. The precise amount will depend on your latitude and the time of year.

As well as displaying the time since the last sunrise you can also optionally show the time until sunset, or since the sun set if it has already gone down.

You can also display the duration of the sun being up and down and the total length of the day between sunrises.

In addition you can display a count of days since the Winter Solstice or from the previous or until the next solstice or equinox. You can also display the calendar dates of the next four equinox & solstice events.

All of these options are shown in the example on the right. The simplest use just shows the hours, minutes and seconds since sunrise.

You need to set your latitude and longitude in the parameters (simple way to find the lat/long for any location is to drop a marker on Google Maps and copy down the numbers it gives you). You can also set various other options - additional text to be displayed in the module, layout options etc.

If you want to change the names used for the solstices, eg Alban Arthan for the winter solstice, then you can find them and edit in the language file (language/en-GB/en-GB.mod_sunclock.ini)

There is a style sheet (found after installation in media/mod_suntime/css/suntime.css). Classes in this sheet are prefixed with "sut_". Set the prefix to a space in the options to use any corresponding template class names, or to "xyz" to disable the style sheet. More simply you can override the style sheet colours in the module settings (Styling tab)

NB The time is updated by a javascipt window timer. Hence you can only display one instance of the module on a page or the 1 sec timer gets confused and the clocks get updated wrong.


Changelog

v1.1.0 30th Dec 2016
Added solstice and equinox dates. Improved timing routines.
v1.0.0 8th Dec 2016
    First release version

Module v4.0.0 29th March 2015

 

New version 4.0.0 New version 4.0.0 now saves tide times to database on first call of day, thus speeding subsequent page loads. Also implemented update server.

The parameters for the module allow selection of main tidal port (from NTSLF list), specification of an offset time, text to appear before and after the table, and how many days to include in the table. If showing only today's tides then you can select either high or low or both tides.

You can also set text to appear above and below the tide times and optionally show the date.

Some hosts block use of file_get_contents() - if you get an error 'NTSLF Page Not Found' try selecting curl instead of fopen in the parameter.

Conversely some hosts do not load the curl library with php - in this case try selecting fopen instead.


Styling

A default stylesheet is installed in the media folder and is referenced by a style prefix (default = 'moduktides_') specified in the parameters. This can either be edited directly (it is in [siteHome]/media/mod_uktides/css/mod_uktides.css ) or overridden in the normal way.

The following classes are used with the prefix: table, td, oddrow, evenrow, pretext, date, posttext, footer.

This is the display code to show how the styling works with the default class prefix:

<div class="moduktides_">
<div class="moduktides_pretext">Text before table
<div class="moduktides_date ">Sun 10 Aug</div>
</div>
<div style="width:150px; margin-left:auto; margin-right:auto; ">
<table style="width:150px;">
<tr class="oddrow">
<td>HW</td><td>05:00</td><td>5.42m</td>
</tr>
<tr class="evenrow">
<td>LW</td><td>11:19</td><td>0.81m</td>
</tr>
<tr class="oddrow">
<td>HW</td><td><b>17:22</b></td><td>5.76m</td>
</tr>
</table>
</div>
<div class="moduktides_posttext">Text after table</div>
<div class="moduktides_footer">Footer text</div>
</div>

 


Changelog

v4.0.0 29th March 2015
    saving data in database so only one call to NTSLF per day
    update server implemented
v3.4.0 27th Nov 2014
    option to select curl or fopen to get table
v3.3.1 25th Sep 2014
    strict standards compliance
v3.3.0 6th August 2014
    Version for Joomla 3.x based on v2.5.1
Module v3.3.1 25th Sept 2014  

SunUpDown is a module to display the time of sunrise and sunset today anywhere in the world.

You set the latitude and longitude of your location, and you can have an optional line of text before and after the times.

Select timezone in the parameters and the sun rise, sunset, and optional local time and date will be displayed adjusted for daylight saving.

Multiple instances can be displayed on the same page with different locations - simply in Module Manager click New and select SunUpDown and set new location parameters.

NB The optional time display is NOT a clock and the times for clock, sunrise and sunset are for the selected timezone at the moment that the module was loaded. Hence on the right the North Cornwall sunrise and sunset is 17 minutes after Greenwich, but the current time is the same. If you wait on this page for a minute the time will not change, if you leave the page displayed overnight it will show yesterday's sunrise and sunset until you refresh it.


Changelog

v3.3.1 25th Sept 2014
    J3 compliance fixes
v3.3.0 17th August 2014
    First version for Joomla 3.x as minimal simple conversion from v1.7.0