time

package
v0.0.0-...-c6016de Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more 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(s 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 value of time.Time

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