Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.4.6 (build 3070) - 23 March 2020
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

24 Hour Time

From build 3044 the development baton passed to Mark Crossley. Mark has been responsible for all the Builds since. He has made the code available on GitHub. It is Mark's hope that others will join in this development, but at the very least he welcomes your ideas for future developments (see Cumulus MX Development suggestions).

Moderator: mcrossley

Post Reply
xlrcomm
Posts: 6
Joined: Sun 09 Dec 2012 1:18 am
Weather Station: Fine Offset with UV light sensor
Operating System: RPi Stretch
Location: Gosnells WA

24 Hour Time

Post by xlrcomm » Wed 05 Jun 2019 1:31 pm

My web pages all show page updated time in 12 hour format.

Code: Select all

charts by Highcharts
page updated 5/06/2019 9:10:01 PM
powered by Cumulus v3.0.0 (3050) 
Noticed the same on some data pages, ie 'This Month' and 'This Year'. All other pages have 24 Hour time.

How can I get all times to be in 24 Hour. I've looked though files but can not see anywhere to change this.

I've tried to use the forum search feature, but it crashes when I try "24 hour" :(

Cheers
Rick
Perth, Western Australia

User avatar
mcrossley
Posts: 6143
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: 24 Hour Time

Post by mcrossley » Fri 07 Jun 2019 9:35 am

You can specify a time format string to all date/time type webtags - read up in the Wiki about how to do this. You will have to edit the web site template files to achieve this. There is no global setting to do what you want - maybe there should be, but it's another for the (very long) todo list!

xlrcomm
Posts: 6
Joined: Sun 09 Dec 2012 1:18 am
Weather Station: Fine Offset with UV light sensor
Operating System: RPi Stretch
Location: Gosnells WA

Re: 24 Hour Time

Post by xlrcomm » Sat 08 Jun 2019 2:46 am

mcrossley wrote:
Fri 07 Jun 2019 9:35 am
You can specify a time format string to all date/time type webtags - read up in the Wiki about how to do this. You will have to edit the web site template files to achieve this. There is no global setting to do what you want - maybe there should be, but it's another for the (very long) todo list!
Thanks Mark.
Yes, that's exactly what I've done now. Edited all the affected pages to include 'format="HH:mm"', including credit on every page.
What puzzles me is that most of the webtags are in 24 hour format. Only a couple pages (thismonthT.htm & thisyearT.htm) webtags use 12 hour format. That's weird.

What I can't work out is the files for the local web port 8998. todayyest.html & records.html are also 12 hour format. That's a tad beyond me.

Cheers,
Rick
Perth, Western Australia

f4phlyer
Posts: 41
Joined: Sun 13 Feb 2011 7:12 pm
Weather Station: Davis Vantage Pro 2
Operating System: RaspBerry Pi Win 10 OSx
Location: Spring, Texas USA
Contact:

Re: 24 Hour Time

Post by f4phlyer » Sun 09 Jun 2019 3:03 am

You might check in the CumulusMX/interface folder/directory, I think that's where the local interface web pages are generated.
Steve
retreat at augusta pines weather
CumulusMX on Raspberry π 3
WeatherUnderground KTXSPRIN538
http://augusta-pines-weather.com

xlrcomm
Posts: 6
Joined: Sun 09 Dec 2012 1:18 am
Weather Station: Fine Offset with UV light sensor
Operating System: RPi Stretch
Location: Gosnells WA

Re: 24 Hour Time

Post by xlrcomm » Sun 09 Jun 2019 3:25 am

f4phlyer wrote:
Sun 09 Jun 2019 3:03 am
You might check in the CumulusMX/interface folder/directory, I think that's where the local interface web pages are generated.
Yes, they are, but alas not so simple.

The html has many calls to javascript files and datatables. I've had a look at the .js and I'm lost. Way beyond me :(

Cheers,
Rick
Perth, Western Australia

User avatar
mcrossley
Posts: 6143
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: 24 Hour Time

Post by mcrossley » Sun 16 Jun 2019 6:46 pm

The data for the admin interface is provided in a json feed. Not something you can alter at source, but you *could* manipulate it in the admin pages themselves. As it they are really meant for just that, admin and a look-see, I do not recommend changing them, they are sometimes updated in new releases.

xlrcomm
Posts: 6
Joined: Sun 09 Dec 2012 1:18 am
Weather Station: Fine Offset with UV light sensor
Operating System: RPi Stretch
Location: Gosnells WA

Re: 24 Hour Time

Post by xlrcomm » Tue 18 Jun 2019 12:49 am

mcrossley wrote:
Sun 16 Jun 2019 6:46 pm
The data for the admin interface is provided in a json feed. Not something you can alter at source, but you *could* manipulate it in the admin pages themselves. As it they are really meant for just that, admin and a look-see, I do not recommend changing them, they are sometimes updated in new releases.
I've looked at the admin html pages (todayyest.html) and 'format="HH:mm"' does not work.
If fact, I've deleted whole sections, ie

Code: Select all

                        <tr>
                            <td>Outdoor Humidity</td>
                            <td><span id="OutdoorHum">--</span></td>
                            <td><span>%</span></td>
                        </tr>
                        <tr>
                            <td>Indoor Humidity</td>
                            <td><span id="IndoorHum">--</span></td>
                            <td><span>%</span></td>
                        </tr>
from

Code: Select all

<table id="HumidityTable" style="width:100%">
                        <thead>
                            <tr>
                                <th>&nbsp;Humidity</th>
                                <th></th>
                                <th></th>
                                <th></th>
                                <th></th>
                            </tr>
                            <tr>
                                <th>&nbsp;</th>
                                <th colspan="2">Today</th>
                                <th colspan="2">Yesterday</th>
                            </tr>
                        </thead>
                        <tr>
                            <td>Outdoor Humidity</td>
                            <td><span id="OutdoorHum">--</span></td>
                            <td><span>%</span></td>
                        </tr>
                        <tr>
                            <td>Indoor Humidity</td>
                            <td><span id="IndoorHum">--</span></td>
                            <td><span>%</span></td>
                        </tr>
                    </table>
and the resultant web page doesn't change. So I think the formatting etc comes from the json feed.
Too hard for me, so I leave it as it is. Maybe one day the code will be updated.

Thanks for the help :)
Cheers,
Rick
Perth, Western Australia

Post Reply