2012-03-22 88 views

回答

1

這對你有幫助嗎?

Date.parse( 「22 + +三月2012」)。的strftime( 「%Y-%間 - %d」)

=> 「2012-03-22」

+0

美麗!要接受我剛更改的變量:Date.parse(「#{params [:end_date]}」)。strftime(「%Y-%m-%d」) – Raoot 2012-03-22 16:46:20

+0

甚至不需要將params散列在一個字符串裏面。 Date.parse(params [:end_date])。strftime(「%Y-%m-%d」) – codenapper 2012-03-23 08:36:35

+0

哦,很酷,我現在就做出調整。 – Raoot 2012-03-23 08:49:10