本月名称(Date.today.month 作为名称) [英] Name of this month (Date.today.month as name)
本文介绍了本月名称(Date.today.month 作为名称)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 Date.today.month
来显示月份数.是否有获取月份名称的命令,或者我需要创建一个案例来获取它?
I'm using Date.today.month
to display the month number. Is there a command to get the month name, or do I need to make a case to get it?
推荐答案
Date::MONTHNAMES[Date.today.month]
会给你一月".(您可能需要先require 'date'
).
Date::MONTHNAMES[Date.today.month]
would give you "January". (You may need to require 'date'
first).
这篇关于本月名称(Date.today.month 作为名称)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文