date conversion 2018-03-27 to 2018 Mar 27

I am doing test using selenium with ruby, I have a web page that has records, one of the columns has dates like 2018 Mar 28 ,

in the search area I have two date pickers from to, when you pick the dates they come like : 2018-03-27 , my question, how to convert :

2018-03-27 to 2018 Mar 27

OR

2018 Mar 27 to 2018-03-27

Thanks,

Have you looked at the Date section of the (stdlib) docs?

One approach:

2.5.1 (main):0 > Date.parse("2018-03-27").strftime("%Y %b %d") => "2018 Mar 27"

HTH,

Thanks Hassan, it works now.