bztime

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Layout      = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order.
	ANSIC       = "Mon Jan _2 15:04:05 2006"
	UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
	RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
	RFC822      = "02 Jan 06 15:04 MST"
	RFC822Z     = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
	RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
	RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
	RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
	RFC3339     = "2006-01-02T15:04:05Z07:00"
	RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
	Kitchen     = "3:04PM"

	// Handy time stamps.
	Stamp      = "Jan _2 15:04:05"
	StampMilli = "Jan _2 15:04:05.000"
	StampMicro = "Jan _2 15:04:05.000000"
	StampNano  = "Jan _2 15:04:05.000000000"
	DateTime   = "2006-01-02 15:04:05"
	DateOnly   = "2006-01-02"
	TimeOnly   = "15:04:05"

	// zero
	DateOnlyWithHZero = "2006-01-02 00:00:00"
	DateOnlyWithMZero = "2006-01-02 15:00:00"
	DateOnlyWithSZero = "2006-01-02 15:04:00"

	// last time
	DateLastTime = "2006-01-02 23:59:59"

	YearAndMonth = "2006-01"
)

Variables

This section is empty.

Functions

func DateTimeToTimestamp

func DateTimeToTimestamp(datetime string) (int64, error)

DateTimeToTimestamp datetime转timestamp

func GetDateListByTime

func GetDateListByTime(t time.Time, layout string, dayNum int, desc bool) []string

func GetMonthListByTime

func GetMonthListByTime(t time.Time, layout string, monthNum int, desc bool) []string

func IsTodayByTimestamp

func IsTodayByTimestamp(timestamp int64) bool

func TimestampFormat

func TimestampFormat(timestamp int64, layout string) string

TimestampFormat timestamp格式化

func TimestampToDatetime

func TimestampToDatetime(timestamp int64) string

TimestampToDatetime timestamp转datetime

func ToTimestamp

func ToTimestamp(datetime string, layout string) (int64, error)

ToTimestamp 转timestamp

Types

This section is empty.

Jump to

Keyboard shortcuts

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