when I print Time.now,
Today is <%= Time.now %>
I get output like
It is now Sat Jun 10 18:39:33 EDT 2006
Is there a simple way to change my code so I just get
It is now June 10, 2006
Thanks…
when I print Time.now,
Today is <%= Time.now %>
I get output like
It is now Sat Jun 10 18:39:33 EDT 2006
Is there a simple way to change my code so I just get
It is now June 10, 2006
Thanks…
Vince W. wrote:
It is now June 10, 2006
Thanks…
See Time#strftime.
Regards,
Dan
Yeah, it’s definitely worth knowing strftime, but here is what you
requested.
Today is <%= Time.now.strftime("%B %d, %Y") %>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs