Skip to content

Instantly share code, notes, and snippets.

@pocari
Created October 18, 2019 16:04
Show Gist options
  • Save pocari/453b8908c634111d06e3408dd2beab2a to your computer and use it in GitHub Desktop.
Save pocari/453b8908c634111d06e3408dd2beab2a to your computer and use it in GitHub Desktop.
golang 日付 parse jst loadlocation parse parseinlocation
package main
import (
"fmt"
"time"
)
func main() {
jst, _ := time.LoadLocation("Asia/Tokyo")
t, err := time.ParseInLocation("Jan 02 2006 15:04:05", "Oct 18 2019 19:35:55", jst)
if err != nil {
panic(err)
}
fmt.Printf("t ... %v\n", t)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment