我以前 php 日期是以 1271952000 时间戳保存的, 现在要格式化为日期,有什么函数啊? 像 date("Y-m-d", $time);
require 'time' Time.at 1271952000 # => 2010-04-23 00:00:00 +0800
OK,解决~ http://stackoverflow.com/questions/10331926/ruby-convert-unix-timestamp-to-date http://stackoverflow.com/questions/7816365/how-to-convert-a-unix-timestamp-seconds-since-epoch-to-ruby-datetime
require 'time' Time.at 1271952000 Tiime.parse '131023190101'