rfc3339

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentZone

func CurrentZone() (string, int)

Return the current time zone.

func FromUnix

func FromUnix(t int64) time.Time

Convert a Unix `time_t` value to a time.

func Parse added in v0.4.1

func Parse(data string) (time.Time, error)

Parse a string to an RFC3339 timestamp.

func TimeToMySQL

func TimeToMySQL(t time.Time) string

Convert a time to a MySQL string.

Types

type JSONRFC3339 added in v0.4.1

type JSONRFC3339 time.Time

An RFC3339 object.

func (JSONRFC3339) Format added in v0.4.1

func (j JSONRFC3339) Format(s string) string

Format an RFC3339 object as a string.

func (JSONRFC3339) MarshalJSON added in v0.4.1

func (j JSONRFC3339) MarshalJSON() ([]byte, error)

Marshal an RFC3339 object to JSON.

func (JSONRFC3339) MySQL added in v0.4.1

func (j JSONRFC3339) MySQL() string

Convert an RFC3339 time to a MySQL timestamp.

func (JSONRFC3339) Time added in v0.4.1

func (j JSONRFC3339) Time() time.Time

convert an RFC3339 time to time.Time.

func (JSONRFC3339) UTC added in v0.4.1

func (j JSONRFC3339) UTC() time.Time

Convert an RFC3339 time to UTC.

func (JSONRFC3339) Unix added in v0.4.1

func (j JSONRFC3339) Unix() int64

Convert an RFC3339 time to Unix time.

func (*JSONRFC3339) UnmarshalJSON added in v0.4.1

func (j *JSONRFC3339) UnmarshalJSON(b []byte) error

Unmarshal an RFC3339 timestamp from JSON.

Jump to

Keyboard shortcuts

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