Thanks.  Somehow neither replies has showed up on my email reader, but they 
are available on the web site, which explains this late reply.

An easier way to convert appears in an old posting on a LibreOffice list:
*https://syslog.me/2012/08/28/dates-from-unix-timestamps-in-openoffice-libreoffice/comment-page-1/*

On Tuesday, October 26, 2021 at 5:30:17 AM UTC-7 [email protected] wrote:

> If you use sqlite, you can use the sqlite3 utility program to convert the 
> datetimes while exporting.  Start sqlite3 and enter these commands
>
> .open /var/lib/weewx/weewx.sdb
> .output export1.csv
> .mode csv
> .headers on
> select datetime(datetime, 'unixepoch', 'localtime') as dt, * from archive;
> .exit
>
> The * in the select statement means "every column in the table" so each 
> row in your export will be the converted datetime followed by all columns 
> in the archive table.  You could replace the * with individual column names 
> if you don't need everything.  Example:
> select datetime(datetime, 'unixepoch', 'localtime') as dt, outtemp, 
> outhumidity, barometer, rain from archive;
>
> Walt
>
> On Monday, October 25, 2021 at 10:58:30 AM UTC-5 vince wrote:
>
>> dateTime is epoch time
>> interval typically is your archive interval (typically 5 minutes but some 
>> folks/stations set theirs differently)
>>
>> On Monday, October 25, 2021 at 8:49:39 AM UTC-7 [email protected] 
>> wrote:
>>
>>> I have just exported my weewx archive into a csv file; all seems in 
>>> order, except that the dates are in internal weewx format, which needs to 
>>> be converted to my own preferred format (which is, for this moment, 
>>> 2021-10-25 08:36).  How is the conversion made?  
>>>
>>> If a formula isn't handy, one can be easily derives using the key 
>>> numbers of the weewx dating system:  Dates similar to weewx internal dates, 
>>> are expressed in terms of an *epoch*, time zero in some generally known 
>>> dating system, and an *interval*, the time represented by a change of 
>>> one unit in the internal dating system. In Unix
>>> the epoch is 00:00:00 UTC on 1 January 1970
>>> and the interval is 1 second.
>>> What are the epoch and interval for weewx internal dates?
>>>
>>> -- 
>>>
>>> Sincerely Jonathan Ryshpan <[email protected]>
>>>
>>>     Fiat justitia, ruant coelis!
>>>
>>>

-- 
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/f908512b-45b5-43f7-89b5-0a04bc5be874n%40googlegroups.com.

Reply via email to