import "github.com/levenlabs/golib/timeutil"
Package timeutil contains functions and types which aid in dealing with time
Timestamp is a wrapper around time.Time which adds methods to marshal and unmarshal the value as a unix timestamp instead of a formatted string
TimestampFromFloat64 returns a Timestamp equal to the given float64, assuming it too is a unix timestamp. The float64 is interpreted as number of seconds, with everything after the decimal indicating milliseconds, microseconds, and nanoseconds
TimestampFromInt64 returns a Timestamp equal to the given int64, assuming it too is a unix timestamp
TimestampFromString attempts to parse the string as a float64, and then passes that into TimestampFromFloat64, returning the result
TimestampNow is simply a wrapper around time.Now which returns a Timestamp.
Float64 returns the float representation of the timestamp in seconds.
GetBSON implements the bson.Getter interface
IsUnixZero returns true if the timestamp is equal to the unix zero timestamp, representing 1/1/1970. This is different than checking if the timestamp is the empty value (which should be done with IsZero)
MarshalJSON returns the JSON representation of the Timestamp as an integer. It never returns an error
SetBSON implements the bson.Setter interface
String returns the string representation of the Timestamp, in the form of a floating point form of the time as a unix timestamp
UnmarshalJSON takes a JSON integer and converts it into a Timestamp, or returns an error if this can't be done
Package timeutil imports 4 packages (graph) and is imported by 4 packages. Updated 2019-05-12. Refresh now. Tools for package owners.