如果我有 @today = Thu Apr 21 2011 00:00:00 GMT 0530 (IST),
如何将 @today
转换为 "Thur April 21, 2011"
?
最佳答案
Time.now.strftime("%a %B %d, %Y")
=> "Fri April 15, 2011"
在你的场合:
@today.to_time.strftime("%a %B %d, %Y")
=> "Thu April 21, 2011"
关于ruby - ROR + 不同格式的 Ruby 日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5674260/