How to the current date and time in EST with Go

1 Answer

0 votes
package main
  
import (
    "fmt"
	"time"
)
  
func main() {
	loc, err := time.LoadLocation("EST")
    if err != nil {
        fmt.Println(err)
    }
    
	now := time.Now().In(loc)
	
	fmt.Println(now)
}
 
 
 
/*
run:
 
2020-08-16 08:51:41.989991995 -0500 EST
 
*/

 



answered Aug 16, 2020 by avibootz

Related questions

1 answer 211 views
1 answer 266 views
1 answer 252 views
1 answer 346 views
1 answer 257 views
257 views asked Aug 7, 2020 by avibootz
1 answer 307 views
7 answers 854 views
854 views asked Aug 7, 2020 by avibootz
...