Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 520 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 520 Bytes

xtime

return atime, mtime, ctime

Example:

package main

import (
	"fmt"
	"io/ioutil"
	"time"

	"github.com/immortal/xtime"
)

func main() {
	files, _ := ioutil.ReadDir("./")
	for _, f := range files {
		a := xtime.Get(f).Atime()
		c := xtime.Get(f).Ctime()
		m := xtime.Get(f).Mtime()
		x := time.Now().Unix() - xtime.Get(f).Ctime().Unix()
		fmt.Printf("atime: %s\nctime: %s\nmtime: %s\ndiff from now: %d\n",
			a.Format(time.RFC3339),
			c.Format(time.RFC3339),
			m.Format(time.RFC3339),
			x,
		)
	}
}