I wrote a Golang program that runs on OpenWRT.
package main
import (
"fmt"
"time"
)
func main(){
fmt.Println(time.Now())
}
When I run this program on my Macbook, I always get the correct local time.
However, when running this program on OpenWRT, I always get UTC time.
I have set the time zone and time of OpenWRT. When I execute uci show system
, I can see the right time zone. When I execute date
the right local time can be display correctly.
So my question is, how do I get the correct local time using Golang's time.Now() on OpenWRT?