title: Rails re-formatting my datetime
body: <p>I have a big query, which collects a collection of models, and I need to format the timestamps in the following manner: <code>YYYY-MM-DDTHH:MI:SS.MSZ</code></p>
  
  <p>So, my query looks like:</p>
  
  <pre><code>models.select("(to_char(created_at, 'YYYY-MM-DD') || 'T' || to_char(created_at, 'HH24:MI:SS.MSZ')) AS created_at").as_json
  </code></pre>
  
  <p>But, when I get the result, I still get <code>created_at</code> field as a DateTime object.
  Nevertheless, if I rename the field in something else, like <code>AS something_else</code>, then I have my required format.</p>
  
  <p>How can I fix the problem, so that it will return created_at in my format, without going through the whole collection, and formatting each model ?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Database I am using is PostreSQL</p>
  
  <p>I traced this behaviour back to ActiveSupport::JSON::Encoder. I use the gem <code>activesupport-json_encoder</code> because I need the setting <code>ActiveSupport.encode_big_decimal_as_string = false</code>, while since Rails 4.1 they by default are encoded as strings.</p>
  
  <p>Now, this Encoder is encoding <code>created_at</code> and <code>updated_at</code> fields as ActiveSupport::TimeWithZone.
  Can I get rid of the latter somehow ?</p>