ftime

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TIMESTAMP 时间戳展示
	TIMESTAMP = FormatType("timestamp")
	// TEXT 文本格式展示
	TEXT = FormatType("text")
)
View Source
const (
	// Length10 10位 精确到秒
	Length10 = TimestampLength(10)
	// Length13 13位 精确到毫秒
	Length13 = TimestampLength(13)
	// Length16 16位 精确到微妙
	Length16 = TimestampLength(16)
	// Length19 19位 精确到纳秒
	Length19 = TimestampLength(19)
)

Variables

View Source
var (
	// UsedTIMESTAMPFormat 当前时间展示的格式
	UsedTIMESTAMPFormat = TIMESTAMP
	// UsedTimestampLength 当前使用的时间戳长度
	UsedTimestampLength = Length13
	// UsedTextFormat 文本格式
	UsedTextFormat = "2006-01-02 15:04:05"
)

Functions

This section is empty.

Types

type FormatType

type FormatType string

FormatType 时间输出的格式

type Time

type Time time.Time

Time 封装Time 主要用于序列化时控制输出格式

func Now

func Now() Time

Now 当前时间

func T

func T(t time.Time) Time

T 类型转换

func (*Time) T

func (t *Time) T() time.Time

T 转化成标准时间对象

func (Time) Timestamp

func (t Time) Timestamp() int64

Timestamp 时间戳

type TimestampLength

type TimestampLength int

TimestampLength 时间戳长度

Jump to

Keyboard shortcuts

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