How do I convert a Time integer to a Date in Ruby?

ruby, ruby-on-rails, ruby-on-rails-3

Solution

Use `Time.at` for this:

t = Time.at(i)

Problem

I'm getting this stamp from an external API: ``` 1391655852 ``` and I need to convert it to a Date. I have seen a lot of conversion pages on the internet and on SO, but they all seem to be going the other way. I'm not familiar with this integer format at all.

Original source

Related problems