github.com/wangyougui/gf/v2@v2.6.5/os/gfile/gfile_z_example_time_test.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/wangyougui/gf.
     6  
     7  package gfile_test
     8  
     9  import (
    10  	"fmt"
    11  
    12  	"github.com/wangyougui/gf/v2/os/gfile"
    13  )
    14  
    15  func ExampleMTime() {
    16  	t := gfile.MTime(gfile.Temp())
    17  	fmt.Println(t)
    18  
    19  	// May Output:
    20  	// 2021-11-02 15:18:43.901141 +0800 CST
    21  }
    22  
    23  func ExampleMTimestamp() {
    24  	t := gfile.MTimestamp(gfile.Temp())
    25  	fmt.Println(t)
    26  
    27  	// May Output:
    28  	// 1635838398
    29  }
    30  
    31  func ExampleMTimestampMilli() {
    32  	t := gfile.MTimestampMilli(gfile.Temp())
    33  	fmt.Println(t)
    34  
    35  	// May Output:
    36  	// 1635838529330
    37  }