How to find the day of week of the current date in Go

1 Answer

0 votes
package main
    
import (
    "fmt"
    "time"
)

func main() {
    weekday := time.Now().Weekday()
    
    fmt.Println(weekday)      
    fmt.Println(int(weekday)) 
}
 
 
   
   
/*
run:
   
Thursday
4
   
*/

 



answered Aug 27, 2020 by avibootz

Related questions

...