Ruby/Time/Convert to Date

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

convert epoch times back into Time objects

epoch_time = Time.gm(2007, 5).to_i
t = Time.at(epoch_time)
puts t.year, t.month, t.day