rfc3339

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 3 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 RFC3339Parse

func RFC3339Parse(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

type JsonRFC3339 time.Time

An RFC3339 object.

func (JsonRFC3339) Format

func (j JsonRFC3339) Format(s string) string

Format an RFC3339 object as a string.

func (JsonRFC3339) MarshalJSON

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

Marshal an RFC3339 object to JSON.

func (JsonRFC3339) MySQL

func (j JsonRFC3339) MySQL() string

Convert an RFC3339 time to a MySQL timestamp.

func (JsonRFC3339) Time

func (j JsonRFC3339) Time() time.Time

convert an RFC3339 time to time.Time.

func (JsonRFC3339) UTC

func (j JsonRFC3339) UTC() time.Time

Convert an RFC3339 time to UTC.

func (JsonRFC3339) Unix

func (j JsonRFC3339) Unix() int64

Convert an RFC3339 time to Unix time.

func (*JsonRFC3339) UnmarshalJSON

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