Debian Codegraph @

docs/content/en/methods/time/Month.md

raw
1 ---
2 title: Month
3 description: Returns the month of the year of the given time.Time value.
4 categories: []
5 keywords: []
6 params:
7 functions_and_methods:
8 returnType: time.Month
9 signatures: [TIME.Month]
10 ---
11
12 To convert the `time.Month` value to a string:
13
14 ```go-html-template
15 {{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
16 {{ $t.Month.String }} → January
17 ```
18
19 To convert the `time.Month` value to an integer.
20
21 ```go-html-template
22 {{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
23 {{ $t.Month | int }} → 1
24 ```