Rails store and retrieve time only in the following format: hh:mm:ss
<p>I generated my model like this:</p>

<pre><code>class CreateMyModel &lt; ActiveRecord::Migration
  def change
    create_table :my_model do |t|
      t.references :place, index: true
      t.time :time_first
      t.time :time_second

      t.timestamps
    end
  end
end
</code></pre>

<p>Saving the model to mysql works fine. The time columns are populated as hh:mm:ss, which is fine. But when I retrieve the entries from mysql, somehow it includes the date from 2000-01-01, example: </p>

<pre><code>2000-01-01T17:00:00Z
</code></pre>

<p>How can I retrieve the time columns as hh:mm:ss?</p>

<p>I'm querying the table entry like this:</p>

<pre><code>my_model = MyModel.find(id)
print my_model.to_json#here time_first and time_second include date.
</code></pre>