Date.month
Date.month
功能
读取月份。
语法
date_value.month()
参数
无参数。
返回值
| 类型 | 说明 |
|---|---|
| Int | 返回 1 到 12 的月份。 |
示例
result = date('2026-06-09 10:11:12').month() // 输出:6 print result
注意事项
- 按本地时区日期读取。
读取月份。
date_value.month()
无参数。
| 类型 | 说明 |
|---|---|
| Int | 返回 1 到 12 的月份。 |
result = date('2026-06-09 10:11:12').month() // 输出:6 print result