timeutil

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: GPL-3.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TimeStamp

type TimeStamp int64

TimeStamp is a type which holds a unix timestamp, but becomes a RFC3339 date when parsed to json. This allows us to save the time as a unix timestamp into the database while returning it as an iso date to the api client.

func FromTime

func FromTime(t time.Time) TimeStamp

FromTime converts a time.Time to a TimeStamp

func (*TimeStamp) MarshalJSON

func (ts *TimeStamp) MarshalJSON() ([]byte, error)

MarshalJSON converts a TimeStamp to a json string

func (*TimeStamp) ToTime

func (ts *TimeStamp) ToTime() time.Time

ToTime returns a time.Time from a TimeStamp

func (*TimeStamp) UnmarshalJSON

func (ts *TimeStamp) UnmarshalJSON(data []byte) error

UnmarshalJSON converts an iso date string from json to a TimeStamp

Jump to

Keyboard shortcuts

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