When serializing the date and time information, it is necessary to choose the proper format. This recipe will illustrate how the time package helps to choose one and do the serialization properly.
When serializing the date and time information, it is necessary to choose the proper format. This recipe will illustrate how the time package helps to choose one and do the serialization properly.
package main
import (
"encoding/json"
"fmt"
"time"
)
func main() {
eur, err := time.LoadLocation("Europe/Vienna")
if err != nil {
panic(err)
}
t := time.Date(2017, 11, 20, 11, 20, 10, 0, eur)
...