如何使用old_datetime
"09:00:09.0012"
old_datetime = Fri, 07 Feb 2014 00:00:00 +0000
(日期时间类型)
这样new_datetime == Fri, 07 Feb 2014 09:00:09.0012 +0000
答案 0 :(得分:0)
require 'date'
new_datetime = DateTime.parse(old_datetime.strftime('%Y-%m-%dT') + "09:00:09.0012")