Setting timezone manually

507 views
Skip to first unread message

Magnus Schmidt

unread,
Feb 18, 2016, 7:08:54 AM2/18/16
to weewx-user
Hello,

 I have a weewx-Installation which replicates the SQLite-database regularly to an server in another timezone. On the target-server wee_reports is run to update the web pages. As the target-server is in another timezone, the report contains the wrong time offset (I want to the times reported of the original station).

How can I set the timezone manually?

I did not find a config option. I tried to run "TZ='Europe/Lisbon'; wee_reports", but this does not work either.

Note: I cannot change the timezone on the server system wide.

Thanks,
Magnus

Thomas Keffer

unread,
Feb 18, 2016, 11:49:27 AM2/18/16
to weewx-user
Unfortunately, changing the timezone system-wide is your only option. Weewx has no notion of timezones. It uses the system zone exclusively.

Making weewx timezone aware would introduce a couple of extra dependencies, plus weewx would have to deal with DST explicitly. 

-tk

--
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 weewx-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Les Niles

unread,
Feb 18, 2016, 9:27:56 PM2/18/16
to weewx...@googlegroups.com
Maybe it depends on the OS… on my debian (wheezy) system, “TZ=US/Eastern; export TZ;  wee_reports” has the desired effect. Magnus, note that TZ needs to be an environment variable (exported or setenved, depending on what shell you’re using).  By default on my debian system, TZ isn’t set, so “TZ=US/Eastern; wee_reports” does NOT work — the “export” is needed.  

  -Les

Thomas Keffer

unread,
Feb 18, 2016, 9:33:20 PM2/18/16
to weewx-user
Very clever, Les. Yes, that could work.

-tk

Magnus Schmidt

unread,
Feb 21, 2016, 9:06:27 AM2/21/16
to weewx-user
Hi Les,

 thanks, your suggestion worked! Timezone is now set correctly and output ist correct. The export statement is indeed mandatory.

Also thanks to Tom for this cool software.

Magnus
Reply all
Reply to author
Forward
0 new messages