I have a string like "2011-06-02T23:59:59+05:30".
I want to convert it to date format and need to parse only the date, "2011-06-02".
require 'date'
d = Date.parse("2011-06-02T23:59:59+05:30")
d.strftime("%F")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With