Skip to content

Commit

Permalink
Fixed bug found by Jon Little; GetDayOfYear() now works with timezone…
Browse files Browse the repository at this point in the history
…-aware datetimes
  • Loading branch information
Brandon Stafford committed Mar 9, 2010
1 parent 943806a commit f382f28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTORS.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Contributions
Many people have contributed to Pysolar since its inception.

Thanks to Brent Pedersen, Holger Zebner, Pietro Zambelli, Sean Taylor, Simeon Obinna
Nwaogaidu, Tim Michelsen, and Lahmeyer International for their
Nwaogaidu, Tim Michelsen, Jon Little, and Lahmeyer International for their
contributions of code, bugfixes, documentation, and general encouragement.
2 changes: 1 addition & 1 deletion solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def GetCoefficient(jme, constant_array):
return sum([constant_array[i-1][0] * math.cos(constant_array[i-1][1] + (constant_array[i-1][2] * jme)) for i in range(len(constant_array))])

def GetDayOfYear(utc_datetime):
year_start = datetime.datetime(utc_datetime.year, 1, 1,)
year_start = datetime.datetime(utc_datetime.year, 1, 1, tzinfo=utc_datetime.tzinfo)
delta = (utc_datetime - year_start)
return delta.days

Expand Down

0 comments on commit f382f28

Please sign in to comment.