Short-bus / pilomar

RaspberryPi based miniature observatory
https://shortbus.blog/
GNU General Public License v3.0
67 stars 14 forks source link

Local timezone setting can be made simpler. #43

Closed Short-bus closed 9 months ago

Short-bus commented 9 months ago

The parameter file contains a local timezone parameter. (LocalTZ) This defaults to 'Europe/London'. It is available for information and if you want to adapt the software further. The program works almost exclusively in UTC times at the moment. You can get the current UTC time with the NowUTC() function. You can get the current LOCAL time with the UTCtoLocal() function. Eg: print("local time is",UTCtoLocal(NowUTC())) If you want to use this function you need to select the correct local timezone value for the parameter file. The list of valid codes is available online, but you can also get it from the pytz package itself. In Python

import pytz print(pytz.all_timezones)

You can set the parameter to any of the values listed there.

pilomar has a useful 'listchooser' function which can be used to make this parameter setting simpler. This is a low priority issue, but easy to implement.