Hi i want to convert my string into date using ruby
Jun 28 2015 to 06/28/2015. Can you help
Hi i want to convert my string into date using ruby
Jun 28 2015 to 06/28/2015. Can you help
Have you tried :
require ‘active_support/time’
Time.parse(‘2015-07-15’)
Att,
Fernando
On Wed, Jul 15, 2015 at 9:06 AM, VIDYA SAGAR POGIRI <
[email protected]> wrote:
To view this discussion on the web visit
.
For more options, visit https://groups.google.com/d/optout.
–
Fernando Kakimoto
http://www.twitter.com/nandokakimoto
http://apidock.com/ruby/DateTime/strftime
require ‘date’
Date.parse(‘Jun 28 2015’).strftime(‘%m/%d/%Y’)
irb(main):003:0> Date.parse(‘Jun 28 2015’).strftime(‘%m/%d/%Y’)
=> “06/28/2015”
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