Created
October 18, 2019 16:04
-
-
Save pocari/453b8908c634111d06e3408dd2beab2a to your computer and use it in GitHub Desktop.
golang 日付 parse jst loadlocation parse parseinlocation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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