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 113 views
1 answer 161 views
1 answer 163 views
1 answer 237 views
1 answer 166 views
166 views asked Aug 7, 2020 by avibootz
7 answers 544 views
544 views asked Aug 7, 2020 by avibootz
1 answer 167 views
167 views asked Aug 7, 2020 by avibootz
...