times

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTimeInSecondsDay

func IsTimeInSecondsDay(timestamp time.Time, ss [2]SecondsInDay) bool

IsTimeInSecondsDay check if the timestamp is in range of the two secondsInDay timestamp

Types

type Duration

type Duration time.Duration

Duration is a alias of time.Duration which supports correct marshaling to YAML and JSON

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON marshals Duration

func (Duration) Seconds

func (d Duration) Seconds() float64

Seconds return the duration as a floating point number of seconds.

func (Duration) TimeDuration

func (d Duration) TimeDuration() time.Duration

TimeDuration convert duration to time.Duration

func (*Duration) UnmarshalJSON

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

UnmarshalJSON unmarshals Duration

type SecondsInDay

type SecondsInDay uint32

SecondsInDay show timestamp in second format in one day

func (SecondsInDay) MarshalJSON

func (s SecondsInDay) MarshalJSON() ([]byte, error)

MarshalJSON translate secondsInDay struct data to string

func (SecondsInDay) String

func (s SecondsInDay) String() string

String output secondsInDay in string format

func (*SecondsInDay) UnmarshalJSON

func (s *SecondsInDay) UnmarshalJSON(d []byte) error

UnmarshalJSON translate string to secondsInDay struct

Jump to

Keyboard shortcuts

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