Documentation
¶
Index ¶
- Constants
- func Format(layout ...string) string
- func GetTimeZone() string
- func Now() time.Time
- func SetTimeZone(zone string)
- func Sign(addDays int) (sign int32, str string)
- func String() string
- func TimeReset(v [3]int)
- func Unix() int64
- func Verify(et ExpireType, v int64) (r bool)
- type ExpireType
- type Times
- func Add(d time.Duration) *Times
- func AddDate(years int, months int, days int) *Times
- func Daily(addDays int) *Times
- func Expire(t ExpireType, v int) (ttl *Times, err error)
- func Monthly(addMonth int) *Times
- func New(v ...time.Time) *Times
- func Parse(value string, layout ...string) (*Times, error)
- func Timestamp(v int64) *Times
- func Weekly(addWeeks int) *Times
- func (this *Times) Add(d time.Duration) *Times
- func (this *Times) AddDate(years int, months int, days int) *Times
- func (this *Times) Daily(addDays int) *Times
- func (this *Times) Expire(t ExpireType, v int) (ttl *Times, err error)
- func (this *Times) Format(layout ...string) string
- func (this *Times) GetTimeZone() string
- func (this *Times) Monthly(addMonth int) *Times
- func (this *Times) New(v ...time.Time) *Times
- func (this *Times) Now() time.Time
- func (this *Times) Parse(value string, layout ...string) (*Times, error)
- func (this *Times) SetTimeZone(zone string)
- func (this *Times) Sign(addDays int) (sign int32, str string)
- func (this *Times) String() string
- func (this *Times) TimeReset(v [3]int)
- func (this *Times) Timestamp(v int64) *Times
- func (this *Times) Unix() int64
- func (this *Times) Verify(t ExpireType, v int64) (r bool)
- func (this *Times) Weekly(addWeeks int) *Times
Constants ¶
View Source
const ( DaySecond int64 = 24 * 60 * 60 WeekSecond int64 = DaySecond * 7 )
Variables ¶
This section is empty.
Functions ¶
func GetTimeZone ¶
func GetTimeZone() string
func SetTimeZone ¶
func SetTimeZone(zone string)
Types ¶
type ExpireType ¶
type ExpireType int8
const ( ExpireTypeNone ExpireType = 0 ExpireTypeDaily ExpireType = 1 ExpireTypeWeekly ExpireType = 2 ExpireTypeMonthly ExpireType = 3 ExpireTypeSecond ExpireType = 4 ExpireTypeCustomize ExpireType = 5 )
type Times ¶
type Times struct { WeekStartDay int //每周开始时间,默认周一 1:周一,0:周日 // contains filtered or unexported fields }
func (*Times) Expire ¶
func (this *Times) Expire(t ExpireType, v int) (ttl *Times, err error)
Expire 过期时间
func (*Times) GetTimeZone ¶
func (*Times) SetTimeZone ¶
Click to show internal directories.
Click to hide internal directories.