amztime

package
v0.0.0-...-a6a3a47 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package amztime implements AWS specific time parsing and deviations

Index

Constants

This section is empty.

Variables

View Source
var ErrMalformedDate = errors.New("malformed date")

ErrMalformedDate always returned for dates that cannot be parsed.

Functions

func ISO8601Format

func ISO8601Format(t time.Time) string

ISO8601Format converts time 't' into ISO8601 time format expected in AWS S3 spec.

This function is needed to avoid a Go's float64 precision bug, where Go avoids padding the extra '0' before the timezone.

func ISO8601Parse

func ISO8601Parse(iso8601 string) (t time.Time, err error)

ISO8601Parse parses ISO8601 date string

func Parse

func Parse(amzDateStr string) (time.Time, error)

Parse parses date string via supported amz date formats.

func ParseHeader

func ParseHeader(timeStr string) (time.Time, error)

ParseHeader parses http.TimeFormat with an acceptable extension for http.TimeFormat - return time might be zero if the timeStr is invalid.

func ParseReplicationTS

func ParseReplicationTS(str string) (time.Time, error)

ParseReplicationTS parse http.TimeFormat first will try time.RFC3339Nano when parse http.TimeFormat failed

Types

This section is empty.

Jump to

Keyboard shortcuts

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