zctime

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Format added in v0.0.3

type Format string

Format zctime时间格式

const (
	TIME_FORMAT_SIMPLE       Format = "20060102150405"          // 简单格式: yyyyMMddHHmmss
	TIME_FORMAT_SLASH        Format = "2006/01/02 15:04:05"     // 斜杠格式: yyyy/MM/dd HH:mm:ss
	TIME_FORMAT_DASH         Format = "2006-01-02 15:04:05"     // 横杠格式: yyyy-MM-dd HH:mm:ss
	TIME_FORMAT_SIMPLE_MILLI Format = "20060102150405.000"      // 带毫秒的简单格式: yyyyMMddHHmmss.SSS
	TIME_FORMAT_SLASH_MILLI  Format = "2006/01/02 15:04:05.000" // 带毫秒的斜杠格式: yyyy/MM/dd HH:mm:ss.SSS
	TIME_FORMAT_DASH_MILLI   Format = "2006-01-02 15:04:05.000" // 带毫秒的横杠格式: yyyy-MM-dd HH:mm:ss.SSS
)

func (Format) FormatTimeToSimpleMilliNoPoint added in v0.0.3

func (ztf Format) FormatTimeToSimpleMilliNoPoint(time time.Time) (string, error)

FormatTimeToSimpleMilliNoPoint 将time转为带毫秒的简单格式字符串,并去除点

func (Format) FormatTimeToStr added in v0.0.3

func (ztf Format) FormatTimeToStr(time time.Time) string

FormatTimeToStr 将time转为Format指定格式的字符串

func (Format) ParseSimpleMilliNoPointToTime added in v0.0.3

func (ztf Format) ParseSimpleMilliNoPointToTime(timeStr string) (time.Time, error)

ParseSimpleMilliNoPointToTime 将带毫秒的简单格式字符串(已去除点)转为time

func (Format) ParseStrToTime added in v0.0.3

func (ztf Format) ParseStrToTime(timeStr string) (time.Time, error)

ParseStrToTime 将Format指定格式的字符串转为time

func (Format) String added in v0.0.3

func (ztf Format) String() string

String 转为string

Jump to

Keyboard shortcuts

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