time

package
v0.0.0-...-a23f37e Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package time implements a new time with specified time format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Time

type Time struct {
	time.Time
}

Time format json time field by myself.

func Now

func Now() Time

Now returns the current time.

func ToTime

func ToTime(str string) (Time, error)

ToTime convert string to Time.

func Unix

func Unix(sec int64, nsec int64) Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON on Time format Time field with %Y-%m-%d %H:%M:%S.

func (*Time) Scan

func (t *Time) Scan(v interface{}) error

Scan valueof time.Time.

func (Time) Unix

func (t Time) Unix() int64

func (Time) Value

func (t Time) Value() (sqldriver.Value, error)

Value insert timestamp into mysql need this function.

Jump to

Keyboard shortcuts

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