datetime

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DateTimeFormat string = "2006-01-02T15:04:05"
	DateFormat     string = "2006-01-02"
	MonthFormat    string = "2006-01"
)

Variables

This section is empty.

Functions

func CurrentMillis

func CurrentMillis() int64

func DurationMillis

func DurationMillis(from int64, to int64) time.Duration

func DurationUtilNow

func DurationUtilNow(fromMillis int64) time.Duration

func HoChiMinhTz

func HoChiMinhTz() (*time.Location, error)

func Millis2Str

func Millis2Str(format string, millis int64, loc *time.Location) string

func Millis2Time

func Millis2Time(millis int64) time.Time

func MillisToStartOfDay

func MillisToStartOfDay(millis int64, loc *time.Location) int64

func MustHoChiMinhTz

func MustHoChiMinhTz() *time.Location

func Str2Millis

func Str2Millis(format string, text string, loc *time.Location) (int64, error)

func Str2Time

func Str2Time(format string, text string, loc *time.Location) (*time.Time, error)

func Time2EndMonth

func Time2EndMonth(t time.Time) time.Time

func Time2Millis

func Time2Millis(t time.Time) int64

func Time2StartMonth

func Time2StartMonth(t time.Time) time.Time

func ToDateStr

func ToDateStr(t time.Time, loc *time.Location) string

func ToDateTimeStr

func ToDateTimeStr(t time.Time, loc *time.Location) string

func ToMonthStr

func ToMonthStr(t time.Time, loc *time.Location) string

func Unix2Time

func Unix2Time(unix int64) time.Time

Types

type Date

type Date time.Time

func Today

func Today() *Date

func (*Date) MarshalJSON

func (d *Date) MarshalJSON() ([]byte, error)

func (*Date) ToEpochUnix

func (d *Date) ToEpochUnix() int64

func (*Date) ToString

func (d *Date) ToString() string

func (*Date) ToTime

func (d *Date) ToTime() time.Time

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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