我得到了这个json和created_time值显示时间的整数格式而不是时间格式,但我希望这个created_time以适当的格式.
如何以正确的格式获取created_time?
如何以正确的格式获取created_time?
"filter"=>"Normal","created_time"=>"1421677966","link"=>"http://instagram.com/p/yCfw5sKorK/","likes"=>{ "count"=>1,"data"=>[ { "username"=>"nikhil.thombare","profile_picture"=>"https://instagramimages-a.akamaihd.net/profiles/anonymousUser.jpg","id"=>"1651917721","full_name"=>"Nikhil Narendra Thombare" } ]
解决方法
你可以使用
Time at
Time.at(created_time)