Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import (
- "fmt"
- "time"
- )
- func main() {
- //now time
- now := time.Now()
- fmt.Println("now ", now)
- zone, _ := now.Zone()
- fmt.Println("zone->", zone)
- ll, llerr := time.LoadLocation(zone)
- fmt.Println("Load Location", ll, llerr)
- // Convert the given time to system based time zone
- t, err := time.ParseInLocation(time.RFC3339, "2017-04-25T23:03:00Z", ll)
- fmt.Println("t - parsein", t)
- fmt.Println("err - parsein", err)
- //fmt.Println("t2 - parse", t.In(ll))
- }```
- Error : ``` unknown time zone IST ```
- Expected: Need to convert any time zone to system time zone.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement