in reply to Time Convert Question

What time are you actually getting? If it works as you are assuming ($somewhere_time, as initialized, in UTC), and the sequential set_time_zone calls assign the original time to UTC and then convert it to NY, I would expect it to show as 04:19:12, not 10:19:12. NY is currently -0400 (behind UTC), not +0200. This assumes that the first call to set_time_zone sets the initial time zone, and the second converts it to NY.

What value are you actually seeing?

--MidLifeXis

Replies are listed 'Best First'.
Re^2: Time Convert Question
by Anonymous Monk on Jun 09, 2011 at 17:16 UTC
    You are right, I am getting "2011-06-09 04:19:12"
Re^2: Time Convert Question
by Anonymous Monk on Jun 09, 2011 at 17:32 UTC
    How would a set this to the right time zone, "NY is currently -0400 (behind UTC), not +0200", thanks for your response.

      Given the other example on this thread, it appears that the first time zone assigned to a floating time is adopted as the time's TZ. Assign the TZ for the floating time value to wherever that value was generated. For all we know, the timezone for that string could be the Aleutian Islands, Anchorage, Alaska, Tokyo, London, or Timbuktu. Until there is something to anchor it to, you cannot do a comparison that has any meaning.

      --MidLifeXis