Welcome to the Cumulus Support forum.

Latest Cumulus MX release v3.0.2 build 3052 - 13 September 2019.
Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014

See the Wiki for downloading either version.

Date format in CumulusMX data causes errors in Cumulus 1

Discussion and questions about Cumulus weather station software version 1. This section and its subforums are the main place to get help with Cumulus. Anything which is not specific to the type of weather station goes in here; for anything specific to a type of weather station, please use the appropriate subforum. Use the 'website development' section for any questions relating to creating or running a web site for Cumulus data. Discussion of the stations themselves in these sections is fine.
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 » Fri 22 Apr 2016 9:56 am

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: 26717
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 » Fri 22 Apr 2016 10:16 am

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: 5677
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Post by mcrossley » Fri 22 Apr 2016 2:11 pm

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: 5677
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

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

Post by mcrossley » Fri 22 Apr 2016 4:38 pm

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: 26717
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 » Fri 22 Apr 2016 4:54 pm

Thanks, Mark, I'll change it so it's the same as the others.
Steve

mingjen
Posts: 3
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Fine Offset (Rosenborg 68750)
Operating System: XP SP3 and Win7
Location: Fyn, Denmark

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

Post by mingjen » 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 :)

water01
Posts: 1551
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: WH1081
Operating System: Windows 7 64bit HP SP1
Location: Somewhere in the USA
Contact:

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

Post by water01 » Sat 03 Aug 2019 1:20 pm

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.

mingjen
Posts: 3
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Fine Offset (Rosenborg 68750)
Operating System: XP SP3 and Win7
Location: Fyn, Denmark

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

Post by mingjen » Sat 03 Aug 2019 3:07 pm

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.

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

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

Post by mcrossley » Sun 04 Aug 2019 9:08 am

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: 3
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Fine Offset (Rosenborg 68750)
Operating System: XP SP3 and Win7
Location: Fyn, Denmark

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

Post by mingjen » Sun 11 Aug 2019 7:17 pm

Thank you very much. I've Got it to work.😊👍

Post Reply