Wee_import: I do not understand the explanations on the dateTime element in the [[FieldMap]]

68 views
Skip to first unread message

P C

unread,
Oct 21, 2021, 5:24:22 AM10/21/21
to weewx-user

Hello,
I am francophone and sometimes have problems with understanding.
I have a CSV file with a Date field named "Date" whose format is declared.
(raw_datetime_format = %Y-%m-%d %H:%M:%S)
What should I inquire in the datetime element?
Thank you for your help,
Pc

gjr80

unread,
Oct 22, 2021, 2:26:02 AM10/22/21
to weewx-user
Hi,

Perhaps it is the language barrier but I am not quite sure what you are asking. As I understand it you have some CSV format data you wish to import using wee_import. Your data has a field named Date that contains date-time information for each row. 

If that is the case you need to set raw_datetime_format to match the format used in your Date field. The default format is %Y-%m-%d %H:%M:%S but you should change this to suit the format of your data. For example, if your Date field contains date-time data of the form 21:55:00 22 10 2021 you would set raw_datetime_format = %H:%M:%S %d %m %Y. If the format was 21:55:00 22 Oct 21 you might use raw_datetime_format = %H:%M:%S %d %B %y. It all depends on your data. The available format codes and their meaning are listed under strftime() and strptime() Format Codes.

One other thing you will need to do is set the mapping of your Date field to the WeeWX dateTime field. You do this by including a/modifying the dateTime setting under [[FieldMap]] in your CSV import config file. In your case something like the following should work (untested):

[CSV]
    ....
    [[FieldMap]]
        dateTime = Date, unix_epoch
        ....

Gary

Blaise Cacramp

unread,
Oct 22, 2021, 6:20:37 AM10/22/21
to weewx...@googlegroups.com

Thank you, you understood me correctly.
In the meantime, I ended up understanding.
thanks again
PC

Le 22-10-21 à 08:26, gjr80 a écrit :
Reply all
Reply to author
Forward
0 new messages