2011-04-06 63 views

回答

4

Time.parse将其转换为Ruby TimeTime#to_i以获得您的Unix时间。

# Load the Time.parse method. 
require 'time' 

Time.parse('Tue, 05 Apr 2011 12:33:00 +0000').to_i 
#=> 1302006780 
+0

谢谢先生!正如我所希望的那样工作。 – PartimeLoser 2011-04-06 02:05:51