time

package
v0.0.0-...-512269d Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const TimeFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func ChangeStrTimeToUTC

func ChangeStrTimeToUTC(strTime string) time.Time

ChangeStrTimeToUTC 把字符串时间转换为UTC时间

func Format

func Format(time time.Time, layout string) string

Format 时间格式化

func FromTimestamp

func FromTimestamp(timestamp int64) time.Time

FromTimestamp 毫秒时间戳转时间

func FromUnix

func FromUnix(unix int64) time.Time

FromUnix 秒时间戳转时间

func GetCurrentTime

func GetCurrentTime() string

GetCurrentTime 返回格式化的当前时间

func GetDay

func GetDay(time time.Time) int

GetDay return yyyyMMdd

func GetTimeFromTimeStamp

func GetTimeFromTimeStamp(timestamp int64) string

func GetTimeStr

func GetTimeStr() string

GetTimeStr ...

func NowTimestamp

func NowTimestamp() int64

NowTimestamp 当前毫秒时间戳

func NowUnix

func NowUnix() int64

NowUnix 秒时间戳

func Parse

func Parse(timeStr, layout string) (time.Time, error)

Parse 字符串时间转时间类型

func ParseTimestamp

func ParseTimestamp(value string) (time.Time, bool)

ParseTimestamp 解析时间戳

func StringifyTime

func StringifyTime(t time.Time) string

StringifyTime 时间转换为字符串

func Time2String

func Time2String(t time.Time) string

func Timestamp

func Timestamp(t time.Time) int64

Timestamp 毫秒时间戳

func WithTimeAsStartOfDay

func WithTimeAsStartOfDay(t time.Time) time.Time

WithTimeAsStartOfDay 返回指定时间当天的开始时间

Types

type Time

type Time struct {
	time.Time
}

func (Time) RawValue

func (t Time) RawValue() interface{}

RawValue 写入数据库

Jump to

Keyboard shortcuts

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