格式可以这样做(我想你指的是HH:MM而不是HH:SS,但很容易更改):
Time.now.strftime("%d/%m/%Y %H:%M")
#=> "14/09/2011 14:09"
更新换班:
d = DateTime.now
d.strftime("%d/%m/%Y %H:%M")
#=> "11/06/2017 18:11"
d.next_month.strftime("%d/%m/%Y %H:%M")
#=> "11/07/2017 18:11"
顺便说一句,你需要require 'date'
英镑.