从号码获取月份名称 [英] Get month name from number
本文介绍了从号码获取月份名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
3
,那么如何从月份号码中获取月份名称? ,我想返回 march
date.tm_month()
如何获取字符串 march
?
解决方案
从中可以看到 calendar.month_name [3]
返回 March
,数组索引 0
是空字符串,因此无需担心零索引
How can I get the month name from the month number?
For instance, if I have 3
, I want to return march
date.tm_month()
How to get the string march
?
解决方案
From that you can see that calendar.month_name[3]
would return March
, and the array index of 0
is the empty string, so there's no need to worry about zero-indexing either.
这篇关于从号码获取月份名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文