M
Mmcolli00 Mom
Hi
I have a time value coming in as a string from another program and I
want to convert it to time class and then to regular time attaching AM
or PM on the end. This is what I have tried.
servertime = "13:05"
servertime.Time
servertime.strftime("%p") #<-this gives a no method error for strftime
I was thinking that if I convert it to time just like using the time
class demonstarted below that it would work the same for a time value.
However it doesn't. Do you know what I am doing wrong? Thanks -M
t = Time.now
t.strftime("I%:%M%p")
I have a time value coming in as a string from another program and I
want to convert it to time class and then to regular time attaching AM
or PM on the end. This is what I have tried.
servertime = "13:05"
servertime.Time
servertime.strftime("%p") #<-this gives a no method error for strftime
I was thinking that if I convert it to time just like using the time
class demonstarted below that it would work the same for a time value.
However it doesn't. Do you know what I am doing wrong? Thanks -M
t = Time.now
t.strftime("I%:%M%p")