I can't understand why Date.utc is making this difference:
Please not that the date is different:
1.9.3-p327 :009 > time = Date.parse("2013-07-04 15:39:45 -0700").to_time
=> 2013-07-04 00:00:00 +0300
and:
1.9.3-p327 :010 > time = Date.parse("2013-07-04 15:39:45 -0700").to_time.utc
=> 2013-07-03 21:00:00 UTC
UPDATE: Even if I provide the UTC within the date string, still 4th of July becomes 3rd.
1.9.3-p327 :017 > time = Date.parse("2013-07-04 1:00:00 UTC").to_time.utc
=> 2013-07-03 21:00:00 UTC
1.9.3-p327 :018 > time = Date.parse("2013-07-04 21:00:00 UTC").to_time.utc
=> 2013-07-03 21:00:00 UTC
1.9.3-p327 :019 > time = Date.parse("2013-07-04 23:00:00 UTC").to_time.utc
=> 2013-07-03 21:00:00 UTC
My guess is this is because Date.parse doesn't accept an indication about UTC as a parameter. How would you make it work? Thanks.