formats

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseMicroSeconds

func UseMicroSeconds(use bool)

UseMicroSeconds sets whether this application (or set of) should use microseconds while dumping date/times or not.

Types

type DateTime

type DateTime primitive.DateTime

DateTime works like time but has a custom formatting.

const DateTimeInvalid DateTime = math.MinInt64

DateTimeInvalid stands for an invalid date/time.

func (*DateTime) MarshalBSONValue

func (ct *DateTime) MarshalBSONValue() (bsontype.Type, []byte, error)

MarshalBSONValue forwards its logic to the given base implementation for primitive.DateTime.

func (DateTime) MarshalJSON

func (ct DateTime) MarshalJSON() ([]byte, error)

MarshalJSON does a JSON marshalling.

func (*DateTime) UnmarshalBSONValue

func (ct *DateTime) UnmarshalBSONValue(t bsontype.Type, data []byte) error

UnmarshalBSONValue is implemented through access to the string value (if string) or the BSON DateTime value (if date-time in database). This serves well for the purpose both for conversions and for simulated updates.

func (*DateTime) UnmarshalJSON

func (ct *DateTime) UnmarshalJSON(b []byte) error

UnmarshalJSON does a JSON de-marshalling through all the available date/time formats until one matches.

Jump to

Keyboard shortcuts

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