Documentation ¶
Index ¶
- func Set(now time.Time)
- func Unset()
- type TimeStamp
- func (ts TimeStamp) Add(seconds int64) TimeStamp
- func (ts TimeStamp) AddDuration(interval time.Duration) TimeStamp
- func (ts TimeStamp) AsLocalTime() time.Time
- func (ts TimeStamp) AsTime() (tm time.Time)
- func (ts TimeStamp) AsTimeInLocation(loc *time.Location) time.Time
- func (ts TimeStamp) AsTimePtr() *time.Time
- func (ts TimeStamp) AsTimePtrInLocation(loc *time.Location) *time.Time
- func (ts TimeStamp) Format(f string) string
- func (ts TimeStamp) FormatDate() string
- func (ts TimeStamp) FormatInLocation(f string, loc *time.Location) string
- func (ts TimeStamp) FormatLong() string
- func (ts TimeStamp) FormatShort() string
- func (ts TimeStamp) IsZero() bool
- func (ts TimeStamp) Year() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TimeStamp ¶
type TimeStamp int64
TimeStamp defines a timestamp
func (TimeStamp) AddDuration ¶
AddDuration adds time.Duration and return sum
func (TimeStamp) AsLocalTime ¶
AsLocalTime convert timestamp as time.Time in local location
func (TimeStamp) AsTimeInLocation ¶
AsTimeInLocation convert timestamp as time.Time in Local locale
func (TimeStamp) AsTimePtrInLocation ¶
AsTimePtrInLocation convert timestamp as *time.Time in customize location
func (TimeStamp) FormatDate ¶
FormatDate formats a date in YYYY-MM-DD server time zone
func (TimeStamp) FormatInLocation ¶
FormatInLocation formats timestamp as given format with spiecific location
func (TimeStamp) FormatLong ¶
FormatLong formats as RFC1123Z
func (TimeStamp) FormatShort ¶
FormatShort formats as short
Click to show internal directories.
Click to hide internal directories.