package main
import (
"log"
"os"
"fmt"
)
func main() {
file, err := os.Create("/tmp/go.txt")
if err != nil {
log.Fatal(err)
}
defer file.Close()
_, err := f.WriteString("www.02405.com\n")
if err != nil {
log.Fatal(err)
}
info, err := os.Stat("/tmp/go.txt")
fmt.Println(info.ModTime())
}
输出:2022-11-09 12:14:55.105010013 +0000 UTC