joeyates/ruby-sun-times — Issue #1: Timezones are not handled correctly
Author: davidcelis
Created: 2011-12-14 20:53:35+00:00
State: open

Say we request the sunset time for a location in PST (UTC-8) on December 13th of this year. The following coordinates are for Portland, OR:

>> SunTimes.calculate(:set, Date.parse('2011-12-13'), 45.52, -122.681944)
=> Tue Dec 13 00:27:23 UTC 2011

Doing the time conversion for this, `12/13/2011 00:27:23 UTC` becomes `12/12/2011 16:27:23 PST`

So instead of receiving the correct sunset time for the correct date (December 13th), we receive the correct sunset time for the incorrect date (December 12th).