Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个日期时间字符串为“2013-01-11 06:30:00 UTC”,我想将其转换为 unix 时间戳 1357887192,以秒为单位。
最方便的方法是什么?谢谢,
只需像这样添加 .to_i :
Time.zone.parse("2013-01-11 06:30:00 UTC").to_i