[2.3] Always convert Time and DateTime objects to local before converting to string

This breaks a whole bunch of Rails tests, which is to be expected because there was previously no timezone handling here at all.

cc @github/timezones @github/rails3 github/github#27189