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