从数字中获取月份名称 [英] Get month name from number

查看:23
本文介绍了从数字中获取月份名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从月份编号中获取月份名称?

How can I get the month name from the month number?

比如我有3,我想返回march

date.tm_month()

如何获取字符串march?

推荐答案

日历 API

由此可以看出calendar.month_name[3]会返回March0的数组索引为空字符串,因此也无需担心零索引.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆