timei

package
v0.0.0-...-1f4ee57 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecondsOfDay    = 24 * 60 * 60
	SecondsOfMinute = 60
	TimeDay         = SecondsOfDay * time.Second
)
View Source
const (
	FormatTime        = "2006-01-02 15:04:05.999999"
	DisplayFormatTime = "2006-01-02 15:04:05"
)
View Source
const TimeFormat = "2006/01/02 - 15:04:05"

Variables

This section is empty.

Functions

func DBNow

func DBNow() string

func Format

func Format(t time.Time) string

func GetTodayZeroTime

func GetTodayZeroTime() time.Time

GetTodayZeroTime 返回今天零点的time

func GetTomorrowYMD

func GetTomorrowYMD(sep string) string

GetTomorrowYMD 得到以sep为分隔符的年、月、日字符串(明天)

func GetYM

func GetYM(time time.Time, sep string) string

GetYM 得到以sep为分隔符的年、月字符串(今天所属于的月份)

func GetYMD

func GetYMD(time time.Time, sep string) string

GetTodayYMD 得到以sep为分隔符的年、月、日字符串(今天)

func GetYesterdayYMD

func GetYesterdayYMD(sep string) string

GetYesterdayYMD 得到以sep为分隔符的年、月、日字符串(昨天)

func GetYesterdayZeroTime

func GetYesterdayZeroTime() time.Time

GetYesterdayZeroTime 返回昨天零点的time

func PgNow

func PgNow() string

func SetUnixSysTime

func SetUnixSysTime(t time.Time)

设置系统时间

func StrToIntMonth

func StrToIntMonth(month string) int

StrToIntMonth 字符串月份转整数月份

func SyncHwTime

func SyncHwTime()

func TimeCost

func TimeCost(start time.Time)

Types

type DateFilter

type DateFilter struct {
	DateStart string `json:"dateStart" explain:"起始时间"`
	DateEnd   string `json:"dateEnd" explain:"结束时间"`
	RangeEnum int    `json:"rangeEnum" explain:"1-今天,2-本周,3-本月,4-今年"`
}

func (*DateFilter) Scope

func (d *DateFilter) Scope() (string, string)

赋值本周期,并返回下周期日期

type Duration

type Duration time.Duration

Duration be used toml unmarshal string time, like 1s, 500ms.

func (Duration) Shrink

Shrink will decrease the duration by comparing with context's timeout duration and return new timeout\context\CancelFunc.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText unmarshal text to duration.

type Time

type Time int64

毫秒

func Time2

func Time2(t time.Time) Time

func (Time) MarshalJSON

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

func (*Time) Scan

func (t *Time) Scan(src interface{}) (err error)

Scan scan time.

func (Time) Time

func (t Time) Time() time.Time

Time get time.

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value get time value.

Jump to

Keyboard shortcuts

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