Last active
October 2, 2016 15:34
-
-
Save jacobg/6437183 to your computer and use it in GitHub Desktop.
For 02-Oct-2016 in Baltimore. Sunrise/set times from myzmanim.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date, datetime, time, timedelta | |
today= date.today() | |
sunrise = datetime.combine(today, time(7,3,56)) | |
sunset = datetime.combine(today, time(17,46,35)) | |
dawn = sunrise - timedelta(minutes=72) | |
dusk = sunset + timedelta(minutes=72) | |
earliest_time = min(dawn + (dusk-dawn)*5/12, sunrise + (sunset-sunrise)*5/12) | |
print('Earliest time = %s' % earliest_time.isoformat()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment