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 236 views
1 answer 113 views
1 answer 160 views
1 answer 166 views
1 answer 162 views
7 answers 543 views
543 views asked Aug 7, 2020 by avibootz
1 answer 165 views
165 views asked Aug 7, 2020 by avibootz
...