20 lines
393 B
Python
20 lines
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
|