Browse files

Fixed bug found by Jon Little; GetDayOfYear() now works with timezone…

…-aware datetimes
  • Loading branch information...
1 parent 943806a commit f382f2872d0168721204146476280126d13c2009 Brandon Stafford committed Mar 9, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 CONTRIBUTORS.markdown
  2. +1 −1 solar.py
View
2 CONTRIBUTORS.markdown
@@ -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.
View
2 solar.py
@@ -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

0 comments on commit f382f28

Please sign in to comment.