Timestamps in import data

53 views
Skip to first unread message

shvman

unread,
Oct 2, 2019, 6:32:34 PM10/2/19
to weewx-user
I run WeeWx using a Davis Vantage Pro2 weather station and a Raspberry Pi v3.

I would like to import several months of WeatherLink data to WeeWx using the WeeWx_import facility.  My textfile records are shown in local date/time.  I thought I might use LibreOffice Calc to generate a timestamp for each record in UTC, but realized that this would necessitate that I take Daylight Saving and Standard times into consideration (no big deal but a potential source of error).  If I instead use the local date/time in the CSV file, will the import program make the appropriate UTC conversions for my time zone?  Or, must the import file contain UTC times, either as date/time or UTC timestamps?

Thanks in advance.

gjr80

unread,
Oct 2, 2019, 8:01:29 PM10/2/19
to weewx-user
Hi,

Provided (1) you have a single field in your CSV data that is consistently formatted in local time and (2) you define an appropriate format string for your CSV date-time data (the raw_datetime_format config option) in your import config file wee_import should be able to decode the CSV date-time field and construct the appropriate epoch timestamp irrespective of daylight saving. The 'conversion' to/from daylight saving is all handled by the underlying python datetime and time modules.

That being said I would suggest a standalone import of a month or two that covers a daylight savings changeover and confirm that you are getting the correct/expected results.

Gary

shvman

unread,
Oct 3, 2019, 7:34:11 AM10/3/19
to weewx-user
Thank you Gary.  I'll do exactly that.  
Reply all
Reply to author
Forward
0 new messages