timepattern

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLayout = "2006-01-02T15:04:05.000Z07:00"

DefaultLayout 是 goark-log 统一的默认时间格式。

Variables

This section is empty.

Functions

func JavaToGo

func JavaToGo(format string) string

JavaToGo 把常用 Java 日期占位符转换为 Go reference time 布局。

Types

type UnixMode

type UnixMode uint8

UnixMode 标识时间格式是否需要输出 Unix 时间戳。

const (
	UnixNone UnixMode = iota
	UnixSeconds
	UnixMillis
	UnixMicros
	UnixNanos
)

func Normalize

func Normalize(format string) (string, UnixMode)

Normalize 把 Log4j/Java 风格时间格式映射为 Go 时间布局或 Unix 输出模式。

Jump to

Keyboard shortcuts

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