How to set date and time in Go

1 Answer

0 votes
package main

import (
    "fmt"
    "time"
)

func main() {
    dt := time.Date(2020, 8, 7, 9, 12, 13, 29, time.UTC) 
 
    fmt.Printf("%v\n", dt) 
}
 
 
/*
run:
 
2020-08-07 09:12:13.000000029 +0000 UTC
 
*/

 



answered Aug 7, 2020 by avibootz

Related questions

1 answer 347 views
1 answer 212 views
1 answer 267 views
1 answer 268 views
1 answer 254 views
7 answers 854 views
854 views asked Aug 7, 2020 by avibootz
1 answer 259 views
259 views asked Aug 7, 2020 by avibootz
...