瀏覽代碼

Bugs fixed.

I've experienced issue when I put in +2 timezone, the script calculates sun elevation for -2 timezone so i changed plus to minus in time.localtime function. Also added support for Daylight saving time.
tags/v.1.4
mihajlo2003petkovic 4 年之前
committed by GitHub
父節點
當前提交
4f568b3141
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      sun.py

+ 2
- 2
sun.py 查看文件

@@ -2,8 +2,8 @@
import ephem
import time
import sys
timezone = change_tz
date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])+(timezone*60*60)))
timezone = change_tz + time.localtime().tm_isdst
date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])-(timezone*60*60)))

obs=ephem.Observer()
obs.lat='change_latitude'


Loading…
取消
儲存