Page 1 of 1

Date Format

Posted: Wed 05 Aug 2020 12:00 pm
by The Dalek Hunter
Years ago I used to use Cumulus running on a Windows machine connected to a Fine Offset USB Station.
The I moved to WeeWX running on a Raspberry Pi connected to the Fine Offset USB Station.
Then I got a Davis Vantage Pro 2 connected to the PI and then for the last two years I have been running a Vantage Pro 2 connected via a USB Data Logger to a Mac Mini running WeatherCat

https://wx-watch.co.uk

I have just got a Weatherlink Live and was looking around for some software to try it out other than Weatherlink. I came across CumulusMX and very rapidly got it set up and working on a Raspberry Pi 4

https://LongSutton-Weather.co.uk

The only thing I would like to alter is the date format - it is US format 2020-08-04 whereas I would like it as 4th August 2020

Thanks

JH

Re: Date Format

Posted: Wed 05 Aug 2020 1:05 pm
by PaulMy
I would like it as 4th August 2020
Looks like you are on the support team... issue resolved!
Conditions at local time 14:01 on 05 August 2020
Enjoy,
Paul

Re: Date Format

Posted: Wed 05 Aug 2020 1:13 pm
by The Dalek Hunter
Yes - it seemed to sort itself out when I set the correct locale on the Raspberry Pi

I can't however sorry out the last rainfall date - it reads "Last rainfall 2020-08-04 11:08"

Can I change that?

JH

Re: Date Format

Posted: Wed 05 Aug 2020 1:20 pm
by freddie
That value is set by a web tag in your template which can be found at CumulusMX/web/indexT.htm

Have a look at web tags in the Wiki for details on how to change the formatting.

Re: Date Format

Posted: Wed 05 Aug 2020 1:48 pm
by The Dalek Hunter
Ok - I have found <#LastRainTipISO> in indexT.htm and changed it to <#LastRainTip> which then changes the output to "Last rainfall 04/08/2020"

The Wiki says I can pass modifiers to <#LastRainTip> to get the format I am after (for example) ie 02:35 on 4th August 2020

How do I pass these modifiers

Many thanks

JH

Re: Date Format

Posted: Wed 05 Aug 2020 1:58 pm
by sfws
The Dalek Hunter wrote: Wed 05 Aug 2020 1:13 pm the last rainfall date - it reads "Last rainfall 2020-08-04 11:08"
freddie wrote: Wed 05 Aug 2020 1:20 pm Have a look at web tags in the Wiki for details on how to change the formatting.
Well done for spotting that the standard web pages (as shown in your image) use an old tag that is fixed format.

Now you have replaced <#LastRainTipISO> with the new web tag only available from release 3.6.1 - <#LastRainTip>, https://cumuluswiki.org/a/Webtags#List_ ... parameters tells you what modifiers are available and gives examples.
The Dalek Hunter wrote: Wed 05 Aug 2020 1:48 pm the format I am after (for example) ie 02:35 on 4th August 2020
<#LastRainTip format="HH:mm' on 'd MMMM yyyy"> gives close to what you want. Note that the literal ' on ' requires its surrounding spaces to be within the single quotes, and because there are other spaces (separating parts of date) the whole format specifier is in double quotes.

The "th" may be possible, but nobody has asked for that format before, so I don't know! Start your search at https://docs.microsoft.com/en-us/dotnet ... at-strings

Re: Date Format

Posted: Wed 05 Aug 2020 2:18 pm
by The Dalek Hunter
Many thanks

All done

JH

Re: Date Format

Posted: Wed 05 Aug 2020 3:26 pm
by mcrossley
sfws wrote: Wed 05 Aug 2020 1:58 pm The "th" may be possible, but nobody has asked for that format before, so I don't know! Start your search at https://docs.microsoft.com/en-us/dotnet ... at-strings
It's not possible using the custom format strings - you'd have to write your own code to do it.