WDC skin date format

60 views
Skip to first unread message

Greg from Oz

unread,
Aug 16, 2023, 11:01:58 PM8/16/23
to weewx-user
Hi,

I have noticed the date format in the headings when I select day, yesterday,week,month,year are correct to how I want them. IE dd/mm/yyy

Like this:
Monthly Weather Conditions
01/08/23 00:00:00 - 31/08/23 23:59:59

But if I go to the Archive and NOAA sidebar and pick something then the date format changes to the US format mm/dd/yyy
Like this:
Monthly Weather Conditions
01/01/2023 12:00:00 AM - 01/31/2023 11:59:59 PM

I have looked through the skin and tmpl files but cannot see anything that I can change.
I have noticed it looks like it picks up the date formatting from daily_archive = %Y-%m-%d in the skin but if that is so I would have expected the format to be yyyy/mm/dd which I would like as it is international ISO standard.

Where is the format for the date set?

Thanks

David Bätge

unread,
Aug 17, 2023, 7:57:42 PM8/17/23
to weewx-user
Hi Greg,

you are referring to the heading on the month page "/month.html" and the month-archive pages, eg "/month-2021-07.html", right?

These Headings at the top of the page use the same format, both use the setting defined in skin.conf [Units][[TimeFormats]]month (see https://github.com/Daveiano/weewx-wdc/blob/3.x/skins/weewx-wdc/skin.conf#L636):

[Units]
    [[TimeFormats]]
        # @see https://weewx.com/docs/customizing.htm#Units_TimeFormats
        day        = %X
        week       = %x
        month      = %x
        year       = %x
        rainyear   = %x
        current    = %x %X
        ephem_day  = %X
        ephem_year = %x
        stats      = %x %X
        daily_archive = %Y-%m-%d

There was a change in the date format in one of the latest releases if I remember correctly. There is a chance that your month archive pages use the old format. This could be the case since these archive pages do not get regenerated after the given archive period (even if templates or configs are changed).

To make sure this is not the case, please remove all month archive pages, and wait for the next wee_report run or start the run by yourself.

rm -rf /var/www/html/weewx/month*

Greg from Oz

unread,
Aug 17, 2023, 8:50:37 PM8/17/23
to weewx-user
Reply all
Reply to author
Forward
0 new messages