Created
September 29, 2018 07:45
-
-
Save jony4/caf9d91fa3dab278dbd4eb85e0a7ff39 to your computer and use it in GitHub Desktop.
go日期包,parse踩坑
This file contains hidden or 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() { | |
t1, _ := time.Parse("2006-01-01", "2010-06-05") | |
fmt.Println(t1) | |
t2, _ := time.Parse("2006-01-02", "2010-06-05") | |
fmt.Println(t2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Play It
result: