xtime

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDate

func FormatDate(dateStr string) (formatDate string)

格式化Date成字符串

格式化前输入样式:2019-01-04T15:40:00Z 或 2019-01-04T15:40:00+08:00
格式化后返回样式:2019-01-04

func FormatDateTime

func FormatDateTime(timeStr string) (formatTime string)

格式化Datetime字符串

格式化前输入样式:2019-01-04T15:40:00Z 或 2019-01-04T15:40:00+08:00
格式化后返回样式:2019-01-04 15:40:00

func ParseDate

func ParseDate(timeStr string) (date time.Time)

解析日期

日期字符串格式:2006-01-02

func ParseDateTime

func ParseDateTime(timeStr string) (datetime time.Time)

解析时间

时间字符串格式:2006-01-02 15:04:05

Types

type Time

type Time int64

Time be used to MySql timestamp converting.

func (*Time) FromDB

func (t *Time) FromDB(bs []byte) error

func (*Time) Scan

func (t *Time) Scan(src interface{}) (err error)

Scan scan time.

func (Time) Time

func (t Time) Time() time.Time

Time get time.

func (Time) ToDB

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

func (Time) Value

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

Value get time value.

Jump to

Keyboard shortcuts

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