timeparser

package
v0.0.0-...-5c7ffcf Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeStyleNormal int = iota

	ParseError = -2
)

Variables

This section is empty.

Functions

func ParseTime

func ParseTime(line string) int64

解析时间

func ParseTimeStyle

func ParseTimeStyle(line string) (TimeElector, *TimeStyle)

Types

type SimpleTimeElector

type SimpleTimeElector struct {
	YearOffsetAdjust int
	// contains filtered or unexported fields
}

func (*SimpleTimeElector) Parse

func (n *SimpleTimeElector) Parse(style *TimeStyle, line string, tz *time.Location) int64

func (*SimpleTimeElector) ParseTimeStyle

func (n *SimpleTimeElector) ParseTimeStyle(line string) *TimeStyle

type TimeElector

type TimeElector interface {
	ParseTimeStyle(line string) *TimeStyle
	Parse(style *TimeStyle, line string, tz *time.Location) int64
}

type TimeElectorWrapper

type TimeElectorWrapper struct {
	Elector TimeElector
	Style   *TimeStyle
}

func DetectTimeElectFromLine

func DetectTimeElectFromLine(line string) *TimeElectorWrapper

type TimeParser

type TimeParser struct {
}

type TimeStyle

type TimeStyle struct {
	YearLeft             string
	YearLeftIndex        int
	Layout               string
	TimestampMillisMode  bool
	TimestampSecondsMode bool
	// HasTimezone is true if layout ends with 'Z07:00'
	HasTimezone bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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