smart_brain/function/helpers.py
2022-12-26 16:54:26 +01:00

20 行
393 B
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import config
import geo
import inspect
import time
def now():
return time.mktime(time.localtime())
def sunrise_time(time_offs_min=30):
return time.mktime(geo.sun.sunrise(config.GEO_POSITION)) + time_offs_min * 60
def sunset_time(time_offs_min=-30):
return time.mktime(geo.sun.sunset(config.GEO_POSITION)) + time_offs_min * 60