strftime

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

strftime

fugee ohu
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: strftime

Ralph Shnelvar
Re: [Rails] strftime fugee,

See
https://www.tutorialspoint.com/ruby/ruby_date_time.htm  for examples.

Ralph



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
[hidden email].
To post to this group, send email to
[hidden email].
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/541654002.20180321041123%40dos32.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: strftime

Colin Law
In reply to this post by fugee ohu
On 21 March 2018 at 10:01, fugee ohu <[hidden email]> 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

That is because you are not calling strftime on a date but on a
String.  The clue is in the error message.

Colin

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLuWCYv6uqbBwe-7j0eakzt%3D7EpQUDOnWpeGUF45PbsLsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.