开发者

ROR + Ruby Date in Different Format

If I have @today = Thu Apr 21 2011 00:00:00 GMT 0530 (IST),

How do 开发者_高级运维I convert @today into "Thur April 21, 2011" ?


Time.now.strftime("%a %B %d, %Y")
=> "Fri April 15, 2011"

In your occasion :

@today.to_time.strftime("%a %B %d, %Y")
=> "Thu April 21, 2011"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜