T = Time.now
TIME = "[#{$T.hour}:#{$T.min}:#{$T.sec}]"
The time format works perfectly for me unless either the minutes, hours
or seconds are 1 digit, it doesnt add a 0 in front of them, i would like
to keep them 2 digits, anyone have any idea?
T = Time.now
TIME = "[#{$T.hour}:#{$T.min}:#{$T.sec}]"
The time format works perfectly for me unless either the minutes, hours
or seconds are 1 digit, it doesnt add a 0 in front of them, i would like
to keep them 2 digits, anyone have any idea?
3:45:8
I want, 03:45:08
Tia
t = Time.now
puts "%02d:%02d:%02d" % [t.hour,t.min,t.sec]