time

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatDateTime = "2006-01-02 15:04:05"
	FormatDate     = "2006-01-02"
	FormatTime     = "15:04:05"

	TimeZoneSH = "Asia/Shanghai"
)

Variables

This section is empty.

Functions

func IntToString

func IntToString(t int) string

IntToString 将int转换为时间字符串 例如: 1560000000 -> 2019-06-09 00:00:00

func IntToStringDate

func IntToStringDate(t int) string

IntToStringDate 将int转换为日期字符串 例如: 1560000000 -> 2019-06-09

func IntToStringTime

func IntToStringTime(t int) string

IntToStringTime 将int转换为时间字符串 例如: 1560000000 -> 00:00:00

func StringToInt

func StringToInt(t string) int

StringToInt 将时间字符串转换为int 例如: 2019-06-09 00:00:00 -> 1560000000

Types

type JsonTime

type JsonTime time.Time

func (JsonTime) MarshalJSON

func (t JsonTime) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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