iso8601

package module
v0.0.0-...-41b4535 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: MIT Imports: 5 Imported by: 0

README

iso 8601 parser and formatter

An ISO8601 Go utility.

  • Time is not yet implemented
  • Duration is mostly implemented

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadFormat is returned when parsing fails
	ErrBadFormat = errors.New("bad format string")

	// ErrNoMonth is raised when a month is in the format string
	ErrNoMonth = errors.New("no months allowed")
)

Functions

func FormatDuration

func FormatDuration(duration time.Duration) string

Types

type Duration

type Duration struct {
	Years   int
	Months  int
	Weeks   int
	Days    int
	Hours   int
	Minutes int
	Seconds int
}

Jump to

Keyboard shortcuts

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