Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. import (
  2. "fmt"
  3. "time"
  4. )
  5.  
  6. func main() {
  7.  
  8. //now time
  9. now := time.Now()
  10. fmt.Println("now ", now)
  11. zone, _ := now.Zone()
  12. fmt.Println("zone->", zone)
  13.  
  14. ll, llerr := time.LoadLocation(zone)
  15. fmt.Println("Load Location", ll, llerr)
  16. // Convert the given time to system based time zone
  17. t, err := time.ParseInLocation(time.RFC3339, "2017-04-25T23:03:00Z", ll)
  18. fmt.Println("t - parsein", t)
  19. fmt.Println("err - parsein", err)
  20. //fmt.Println("t2 - parse", t.In(ll))
  21.  
  22. }```
  23.  
  24. Error : ``` unknown time zone IST ```
  25. Expected: Need to convert any time zone to system time zone.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement