Я пытаюсь вернуть дату в виде строки, но удаляю первые 0 из возвращенного часа.
Это код, который я использую:
t = Time.new
current_date = Time.local(t.year, t.month, t.day, t.hour, t.min/30*30)
time_str = current_date.strftime("%I.%M+%p").downcase
puts time_str
Outputs:
03.00+pm
Expected output:
3.00+pm # need to remove the last zero from the hour(s)