Back to Hugo

Month

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

0.161.1311 B
Original Source

To convert the time.Month value to a string:

go-html-template
{{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
{{ $t.Month.String }} → January

To convert the time.Month value to an integer.

go-html-template
{{ $t := time.AsTime "2023-01-27T23:44:58-08:00" }}
{{ $t.Month | int }} → 1