GoFrame gfile-文件時(shí)間

2022-04-09 11:06 更新

文件時(shí)間

MTime

  • 說明:獲取路徑修改時(shí)間
  • 格式: 
func MTime(path string) time.Time 
  • 示例:
func ExampleMTime() {
	t := gfile.MTime(gfile.TempDir())
	fmt.Println(t)

	// May Output:
	// 2021-11-02 15:18:43.901141 +0800 CST
}

MTimestamp

  • 說明:獲取路徑修改時(shí)間戳(秒)
  • 格式: 
func MTimestamp(path string) int64
  • 示例:
func ExampleMTimestamp() {
	t := gfile.MTimestamp(gfile.TempDir())
	fmt.Println(t)

	// May Output:
	// 1635838398
}

MTimestampMilli

  • 說明:獲取路徑修改時(shí)間戳(毫秒)
  • 格式: 
func MTimestampMilli(path string) int64
  • 示例:
func ExampleMTimestampMilli() {
	t := gfile.MTimestampMilli(gfile.TempDir())
	fmt.Println(t)

	// May Output:
	// 1635838529330
}


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)