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

1 answer 249 views
249 views asked Aug 27, 2020 by avibootz
1 answer 207 views
207 views asked Aug 27, 2020 by avibootz
1 answer 210 views
1 answer 163 views
1 answer 168 views
168 views asked Aug 13, 2020 by avibootz
...