try

raw_datetime_format = %Y%m%d%H%M (that you already have)

and in the field map just

datetime = RecDate

assuming RecDate is the header name of the date/time - drop the unix_epoch addition

if it still doesn't work, please provide the header line and the complete first 2 lines of your import file

On 11.03.2023 11:37, William wrote:
Hi,

I'm trying to import historical data into my new weewx installation. Following the documentation and the sample import config, I can't seem to get the date and time to parse correctly. I'm using weewx version 4.10.2 and wee_import version 0.7, as both were pulled down through the apt package repository today.

In my archive data, my date and time are stored in a RecDate field and uses the format YYYYmmddHHMM. Example: 201105060957 would be more appropriately readable as 2011-05-06 09:57.

In the import configuration file I have raw_datetime_format = %Y%m%d%H%M, and in the FieldMap stanza, dateTime = RecDate, unix_epoch.

When I do a dry run on a single record, it shows a wild date (year 8342!) with the message:

Unique records processed: 1; Last timestamp: 8342-10-07 16:55:57 EDT (201105060957)

When I run it on a different data set it sees 202303110321 as timestamp: 8380-09-24 00:25:21 EDT

Am I missing something in the config? I'm fairly certain the Python strptime format is correct, and have tested it in a Python script:
dateTime = datetime.strptime('201105060957', '%Y%m%d%H%M')

returns
datetime.datetime(2011, 5, 6, 9, 57)
Any feedback would be greatly appreciated. Thank you!
--
You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/42a18d84-9140-42c1-9172-c417f42659cfn%40googlegroups.com <https://groups.google.com/d/msgid/weewx-user/42a18d84-9140-42c1-9172-c417f42659cfn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/41524a5f-a2f7-2a26-9857-1bcb8f58b459%40gmail.com.

Reply via email to