Skip to content

Instantly share code, notes, and snippets.

@icasimpan
Last active January 4, 2021 03:29
Show Gist options
  • Save icasimpan/34727d89ecd62afc1589eb38cefce0f2 to your computer and use it in GitHub Desktop.
Save icasimpan/34727d89ecd62afc1589eb38cefce0f2 to your computer and use it in GitHub Desktop.
golang: getting today's week number
package main
import "fmt"
import "time"
func main() {
var time_now time.Time = time.Now() // [ALTERNATIVE] time_now := time.Now()
var _, wk_num = time_now.ISOWeek() // [ALTERNATIVE] _, wk_num := time_now.ISOWeek()
fmt.Println(wk_num)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment