Do you say that you want 11am and 10pm, and then the opportunity until 11:00 and 22:00, or do you want to show 11:00 and 22:00 instead of 11:00 and 10:00?
if his second question is here:
%H - Hour of the day, 24-hour clock (00 to 23).
#!/usr/bin/ruby -w
time = Time.new
puts time.to_s
puts time.ctime
puts time.localtime
puts time.strftime("%H:%M")
if his first question says:
%I Hour of the day, 12-hour clock (01 to 12).
time = Time.new
timeSwitch = 1
if (timeSwitch == 1)
puts time.strftime("%H:%M")
else
puts time.strftime("%I:%M")
end
Sorry, Perl and Ruby were mixed in syntax
source
share