dateparse

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDateWithFormat

func ParseDateWithFormat(date, format string) (interface{}, error)

ParseDateWithFormat parses the date string according to the given format string, as defined in the MySQL specification.

Reference the MySQL docs for valid format specifiers. This implementation attempts to match the spec to the extent possible.

More info: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format

Even more info: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_str-to-date

Types

type ParseLiteralErr

type ParseLiteralErr struct {
	Literal byte
	Tokens  string
	// contains filtered or unexported fields
}

ParseLiteralErr defines a error when attempting to parse the date string input according to a literal character specified in the format string.

func (ParseLiteralErr) Error

func (p ParseLiteralErr) Error() string

func (ParseLiteralErr) Unwrap

func (p ParseLiteralErr) Unwrap() error

type ParseSpecifierErr

type ParseSpecifierErr struct {
	Specifier byte
	Tokens    string
	// contains filtered or unexported fields
}

ParseSpecifierErr defines a error when attempting to parse the date string input according to a specified format directive.

func (ParseSpecifierErr) Error

func (p ParseSpecifierErr) Error() string

func (ParseSpecifierErr) Unwrap

func (p ParseSpecifierErr) Unwrap() error

Jump to

Keyboard shortcuts

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