Created
February 19, 2019 10:23
-
-
Save williamlsh/c45cc897c58c226a7c8413a63380ea4a to your computer and use it in GitHub Desktop.
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
func birthTime(){ | |
sampleFile := "testdata/sample.md" | |
fi, err := os.Stat(sampleFile) | |
if err != nil { | |
return | |
} | |
// fmt.Printf("file info: %v", fi.ModTime()) | |
stat := fi.Sys().(*syscall.Stat_t) | |
birthTime := time.Unix(stat.Birthtimespec.Unix()).Unix() | |
fmt.Println(birthTime) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment