strftime

13 views
Skip to first unread message

fugee ohu

unread,
Mar 21, 2018, 6:01:39 AM3/21/18
to Ruby on Rails: Talk
How do i apply strftime to a date and save it to a variable as a string? I get errors like 

undefined method `strftime' for "2018/03/29 00:07":String Did you mean? strip

Ralph Shnelvar

unread,
Mar 21, 2018, 6:11:58 AM3/21/18
to fugee ohu




Wednesday, March 21, 2018, 4:01:39 AM, you wrote:

How do i apply strftime to a date and save it to a variable as a string? I get errors like
undefined method `strftime' for "2018/03/29 00:07":String Did you mean? strip
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-ta...@googlegroups.com.
To post to this group, send email to
rubyonra...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/93aee861-d648-445f-aee1-8b555a31dd2d%40googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.




Ralph

Colin Law

unread,
Mar 21, 2018, 8:27:53 AM3/21/18
to Ruby on Rails: Talk
That is because you are not calling strftime on a date but on a
String. The clue is in the error message.

Colin
Reply all
Reply to author
Forward
0 new messages