Strftime of datetime
I got the below code which I would like to convert to a string in a specific format. But I can't get it working.
Date.today + warning.notify_time_close.seconds
What I want to do is somethin like this but i开发者_如何学Got doesn't work :)
(Date.today + warning.notify_time_close.seconds).strftime "%d-%m-%Y %H:%M:%S"
I know its simple but just don't know how to do it :)
Thanks in advance!
Kenneth
This should not be necessary, but as a workaround you could try this:
Time.at(
Date.today.to_time.to_i + warning.notify_time_close.seconds
).strftime("%d-%m-%Y %H:%M:%S")
精彩评论