sgtime

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ONE_DAY_SECOND  = 60 * 60 * 24
	ONE_HOUR_SECOND = 60 * 60
)
View Source
const (
	FORMAT_TIME_NORMAL = "2006-01-02 15:04:05"
	FORMAT_TIME_LOG    = "2006/01/02 15:04:05.000"
	FORMAT_TIME_YEAR   = "2006"
	FORMAT_TIME_MONTH  = "01"
	FORMAT_TIME_DAY    = "02"
	FORMAT_TIME_HOUR   = "15"
	FORMAT_TIME_MINUTE = "04"
	FORMAT_TIME_SECOND = "05"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DateTime

type DateTime struct {
	// contains filtered or unexported fields
}

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) *DateTime

func New

func New() *DateTime

func (*DateTime) Add

func (dateTime *DateTime) Add(seconds int) *DateTime

func (*DateTime) AddDate

func (datetime *DateTime) AddDate(year int, month int, day int)

func (*DateTime) Before

func (dateTime *DateTime) Before(other *DateTime) bool

func (*DateTime) Day

func (dateTime *DateTime) Day() int

func (*DateTime) DayString

func (dateTime *DateTime) DayString() string

func (*DateTime) GetTotalDay

func (dateTime *DateTime) GetTotalDay() int64

func (*DateTime) GetTotalSecond

func (dateTime *DateTime) GetTotalSecond() int64

func (*DateTime) Hour

func (dateTime *DateTime) Hour() int

func (*DateTime) HourString

func (dateTime *DateTime) HourString() string

func (*DateTime) Location

func (datetime *DateTime) Location() *time.Location

func (*DateTime) LogString

func (dateTime *DateTime) LogString() string

func (*DateTime) Minute

func (dateTime *DateTime) Minute() int

func (*DateTime) MinuteString

func (dateTime *DateTime) MinuteString() string

func (*DateTime) Month

func (dateTime *DateTime) Month() time.Month

func (*DateTime) MonthString

func (dateTime *DateTime) MonthString() string

func (*DateTime) NormalString

func (dateTime *DateTime) NormalString() string

func (*DateTime) Parse

func (dateTime *DateTime) Parse(timestr string, format string)

func (*DateTime) Second

func (dateTime *DateTime) Second() int

func (*DateTime) SecondString

func (dateTime *DateTime) SecondString() string

func (*DateTime) Sub

func (dateTime *DateTime) Sub(other *DateTime) *DateTimeDuration

func (*DateTime) Year

func (dateTime *DateTime) Year() int

func (*DateTime) YearString

func (dateTime *DateTime) YearString() string

type DateTimeDuration

type DateTimeDuration struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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