Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Date format in CumulusMX data causes errors in Cumulus 1

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
EdE
Posts: 9
Joined: Tue 29 Dec 2015 10:41 am
Weather Station: Aercus WS3083
Operating System: Windows 7
Location: Bournemouth, UK

Date format in CumulusMX data causes errors in Cumulus 1

Post by EdE »

I have been running Cumulus MX on a RPi but now want to run in Cumulus 1 on my Windows PC. Cumulus 1 complains about the date format in the Cumulus MX files.

The Cumulus MX files seem to have the format yyyy-mm-ddThh:mm:ss whereas Cumulus 1 wants dd/mm/yyyy hh:mm:ss

I am running Cumulus V1.9.4 build 1099 and Cumulus MX v3.0.0.0 build 3038

Is there anyway to make the files compatible between the two versions or a filter I can put them through to convert the date format?

Thanks,

Ed
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by steve »

I switched to using ISO format in the ini files in MX (I assume it's the ini files you're referring to?) specifically to avoid incompatible format problems. I'm surprised that the system routines in Cumulus 1 don't recognise the ISO format dates. Having said that, it is not my intention to keep MX backwards compatible with Cumulus 1. You will either need to edit the files manually, or perhaps someone can come up with a script to do the conversion.
Steve
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by mcrossley »

You could convert all ISO strings to dd/mm/yy hh:mm:ss with a bit of PowerShell script...

Code: Select all

#prompt for input file
$file = Read-Host -Prompt 'Input file name to convert';

#get file content
$content = Get-Content $file;

#change all ISO dates to dd/mm/yyyy hh:mm:ss
$content = $content -replace '([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2})', '$3/$2/$1 $4';

#backup the original file
Rename-Item -path $file -NewName ($file -replace 'ini','bak ');

#write the revised content back to original filename
Set-Content -Path $file -Value $Content;
Or even (run the script from the same folder as the ini files)...

Code: Select all


$files = ('alltime.ini', 'month.ini', 'today.ini', 'year.ini', 'yesterday.ini');

foreach ($file in $files) {
	Write-Host "Processing file: $file ..."
	
	#get file content
	$content = Get-Content $file;

	#change all ISO dates to dd/mm/yyyy hh:mm:ss
	$content = $content -replace '([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2})', '$3/$2/$1 $4';

	#backup the original file
	Rename-Item -path $file -NewName ($file -replace 'ini','bak ');

	#write the revised content back to original filename
	Set-Content -Path $file -Value $Content;
}
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by mcrossley »

Steve, I did notice when I was testing that script that the [Rain] HTime field in yesterday.ini has the date prefixed when none of the others do, nor does it in today.ini
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by steve »

Thanks, Mark, I'll change it so it's the same as the others.
Steve
mingjen
Posts: 35
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Fyn, Denmark
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by mingjen »

Hello. I read that it is possible to run a script to convert cumulusMX inifiles to be used in cumulus 1. can anyone explain exactly how it is done. in what language is the script written? I will use it on a windows 10 PC :)
https://mingjen.net/odense
Davis Vantage Pro2 weather station
CumulusMX
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by water01 »

Why don't you move the files and just run Cumulus MX on Windows 10. Cumulus 1 is an older version and it seems a bit strange to go backwards.
David
Image
mingjen
Posts: 35
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Fyn, Denmark
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by mingjen »

It is because I think the old wersion of Cumulus is perfect if I want to see historical data, but The MX version is better in uploading weather data to various sites.
I am not strong in programing, so I thought I could use the script mentioned in this thread to make a quick translation from MX to Cumulus 1.
https://mingjen.net/odense
Davis Vantage Pro2 weather station
CumulusMX
User avatar
mcrossley
Posts: 12695
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by mcrossley »

mingjen wrote: Sat 03 Aug 2019 12:16 pm Hello. I read that it is possible to run a script to convert cumulusMX inifiles to be used in cumulus 1. can anyone explain exactly how it is done. in what language is the script written? I will use it on a windows 10 PC :)
The script(s) are above, they are written in PowerShell. Save as a file with a .PS1 suffix, then they should run on Windows 10.
mingjen
Posts: 35
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Fyn, Denmark
Contact:

Re: Date format in CumulusMX data causes errors in Cumulus 1

Post by mingjen »

Thank you very much. I've Got it to work.😊👍
https://mingjen.net/odense
Davis Vantage Pro2 weather station
CumulusMX
Post Reply