time

package
Version: v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, MPL-2.0 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 (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) Value

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

Value insert timestamp into mysql need this function.

Source Files

Jump to

Keyboard shortcuts

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