How to the current date and time in MST with Go

1 Answer

0 votes
package main
  
import (
    "fmt"
	"time"
)
  
func main() {
	loc, err := time.LoadLocation("MST")
    if err != nil {
        fmt.Println(err)
    }
    
	now := time.Now().In(loc)
	
	fmt.Println(now)
}
 
 
 
/*
run:
 
2020-08-16 06:53:05.055639598 -0700 MST
 
*/

 



answered Aug 16, 2020 by avibootz

Related questions

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