Skip to content

Commit

Permalink
Allow odd timezones in sun.py (#1056)
Browse files Browse the repository at this point in the history
* fixes #1021

* fixes #1055
  • Loading branch information
jp112sdl authored Aug 28, 2024
1 parent 3d23c34 commit 62b014f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/tools/sun.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
load_envbash(config_file)

# Use subprocess to get the local time offset from UTC
timezone = int(subprocess.check_output('echo $(date "+%:::z") | sed "s/\\([+-]\\)0\\?/\\1/"', shell=True, text=True))
timezone = float(subprocess.check_output('echo $(date "+%:::z") | sed "s/\\([+-]\\)0\\?/\\1/" | sed "s/:30/.5/"', shell=True, text=True))

date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1]) - (timezone * 60 * 60)))

Expand Down

0 comments on commit 62b014f

Please sign in to comment.