mirror of https://github.com/Wox-launcher/Wox
20 lines
316 B
Go
20 lines
316 B
Go
package util
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
"time"
|
|
)
|
|
|
|
func GetFileCreatedAt(path string) string {
|
|
stat, err := os.Stat(path)
|
|
if err != nil {
|
|
return "-"
|
|
}
|
|
|
|
statSys := stat.Sys().(*syscall.Win32FileAttributeData)
|
|
creationTime := time.Unix(0, statSys.CreationTime.Nanoseconds())
|
|
|
|
return FormatTime(creationTime)
|
|
}
|