date

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat         = "2006-01-02 15:04:05"
	TimeFormatYYYYMMDD = "20060102"
)

Variables

View Source
var TimeFormatMap = map[string]string{
	"Y": "2006",
	"n": "1",
	"m": "01",
	"j": "2",
	"d": "02",
	"H": "15",
	"i": "04",
	"s": "05",
	"J": "05.000",
	"Q": "05.000000",
	"K": "05.000000000",
}

用来格式化时间

Functions

func Date

func Date(format string, timestamp ...int64) string

*

  • 类似php的date()函数 *
  • @param
  • @return *

func Now

func Now() string

func StrToTime

func StrToTime(datetime string, format string) time.Time

func StrToTimestamp

func StrToTimestamp(datetime string, format string) int64

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL