---
title: "Discussion on \"Go Cheatsheet - Print time in timezone\" | Hashnode"
description: "Discussion on \"Go Cheatsheet - Print time in timezone\". 1, LoadLocation\n2, Call time.In method\npackage main\n\nimport (\n    \"log\"\n    \"time\"\n)\n\nfunc main() {\n    t := time.Now()\n    loc, err := time.LoadLocation(\"Asia/Shanghai\")\n    if err != nil {\n        log.Fatalf(\"%s\\n\", err)\n    }\n    locTime := t.In(l..."
url: "https://hashnode.com/posts/go-cheatsheet-print-time-in-timezone/61256bf4663d427e19ffb2af"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Go Cheatsheet - Print time in timezone](https://hn.0xbf.me/go-cheatsheet-print-time-in-timezone?utm_source=hashnode&utm_medium=feed)

1, LoadLocation 2, Call time.In method package main import ( "log" "time" ) func main() { t := time.Now() loc, err := time.LoadLocation("Asia/Shanghai") if err != nil { log.Fatalf("%s\\n", err) } locTime := t.In(l...

Aug 24, 2021 · 1 min read · hn.0xbf.me  
Updated Sep 9, 2021  
Read the article

-   [#go](https://hashnode.com/tag/go)

## Written by

[0xBF](https://hashnode.com/@0xbf)

@0xbf

  
[View profile](https://hashnode.com/@0xbf)

## Responses 1

Markdown supported · ⌘↵ to post

[Wei Lun](https://hashnode.com/@weilun)

[Aug 25, 2021](https://hashnode.com/posts/go-cheatsheet-print-time-in-timezone/61256bf4663d427e19ffb2af/comment/61259c22663d427e19ffb4e1)

any recommended libraries to print localise date format?
