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