simpletime

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

* @Author: wei-g @Date: 2020/11/25 3:01 下午 @Description: 简化时间序列化操作等有关处理

本文件部分代码实现借鉴 https://www.liwenzhou.com/posts/Go/json_tricks_in_go/#autoid-0-0-12

Index

Constants

View Source
const (
	SecondTimeLayoutNano = "2006-01-02 15:04:05 MST" // 精确到秒,带时区信息

)

Variables

This section is empty.

Functions

This section is empty.

Types

type SecondTime

type SecondTime time.Time

SecondTime 精确到秒的时间序列化

func (*SecondTime) IsSet

func (s *SecondTime) IsSet() bool

IsSet 判断Time是否为正确设置

func (*SecondTime) MarshalJSON

func (s *SecondTime) MarshalJSON() (data []byte, err error)

MarshalJSON json 序列化接口

func (*SecondTime) UnmarshalJSON

func (s *SecondTime) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON json 反序列化接口

func (SecondTime) Value added in v0.3.2

func (s SecondTime) Value() (driver.Value, error)

Value 满足 database/sql 库要求

Jump to

Keyboard shortcuts

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