Documentation
¶
Index ¶
Constants ¶
View Source
const ( MILLISECONDS TimeUnit = "milliseconds" SECONDS = "seconds" MINUTES = "minutes" HOURS = "hours" DAYS = "days" WEEKS = "weeks" MONTHS = "months" YEARS = "years" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelativeTime ¶
type RelativeTime struct {
RTvalue int `json:"value,omitempty"`
RTunit TimeUnit `json:"unit,omitempty"`
}
func NewRelativeTime ¶
func NewRelativeTime(value int, unit TimeUnit) *RelativeTime
func (*RelativeTime) RelativeTimeTo ¶
func (rt *RelativeTime) RelativeTimeTo(t time.Time) time.Time
func (*RelativeTime) Unit ¶
func (rt *RelativeTime) Unit() TimeUnit
func (*RelativeTime) Value ¶
func (rt *RelativeTime) Value() int
Click to show internal directories.
Click to hide internal directories.