Documentation
¶
Index ¶
- Constants
- Variables
- func AppendFormat(dst []byte, format string, datetime time.Time) ([]byte, error)
- func Format(format string, datetime time.Time) ([]byte, error)
- func FormatStr(format string, datetime time.Time) (string, error)
- func FormatString(format string, datetime time.Time) (string, error)
- func LoadLocation(name string) (*time.Location, error)
- func Relative(raw string) (dur time.Duration, err error)
- func TimeToBytes(dst []byte, val any, args ...any) ([]byte, error)
- type Clock
- type Interface
- type Native
- type Stuck
Constants ¶
View Source
const ( StatusIdle int32 = iota StatusActive )
View Source
const ( Layout = "%m/%d %H:%M:%S%p '%y %z" ANSIC = "%a %b %e %H:%M:%S %Y" UnixDate = "%a %b %e %H:%M:%S %Z %Y" RubyDate = "%a %b %d %H:%M:%S %z %Y" RFC822 = "%d %b %y %H:%M %Z" RFC822Z = "%d %b %y %H:%M %z" RFC850 = "%A, %d-%b-%y %H:%M:%S %Z" RFC1123 = "%a, %d %b %Y %H:%M:%S %Z" RFC1123Z = "%a, %d %b %Y %H:%M:%S %z" RFC3339 = "%Y-%m-%dT%H:%M:%S%z" RFC3339Nano = "%Y-%m-%dT%H:%M:%S.%n%z" Kitchen = "%L:%M%p" Stamp = "%b %e %H:%M:%S" StampMilli = "%b %e %H:%M:%S.%i" StampMicro = "%b %e %H:%M:%S.%o" StampNano = "%b %e %H:%M:%S.%N" )
Variables ¶
Functions ¶
func AppendFormat ¶
func FormatString ¶ added in v1.1.4
func LoadLocation ¶ added in v1.1.4
LoadLocation returns Location for given name.
Types ¶
type Clock ¶
type Clock struct {
// Clock precision.
// Settings this param too small (less than microseconds) or too big (great than second) is counterproductive.
Precision time.Duration
// contains filtered or unexported fields
}
Clock is a fast replacement of base methods of time package.
func NewClock ¶
func NewClock() *Clock
NewClock makes new clock with default precision (1 millisecond).
func NewClockWP ¶
NewClockWP makes new clock with given precision.
Click to show internal directories.
Click to hide internal directories.