Answers for "get weekday from time golang"

Go
0

golang get day of week from time

weekday := time.Now().Weekday()
fmt.Println(weekday)      // "Tuesday"
fmt.Println(int(weekday)) // "2"
Posted by: Guest on June-24-2020
0

golang get current week number from date

tn := time.Now().UTC()
fmt.Println(tn)
year, week := tn.ISOWeek()
fmt.Println(year, week)
Posted by: Guest on December-09-2021

Browse Popular Code Answers by Language