iso8601

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package iso8601 provides a parser for ISO-8601 durations.

See:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(v string) (d time.Duration, err error)

Parse parses an ISO-8601 duration.

The lexical representation for duration is the [ISO 8601] extended format:

  • PnYnMnDTnHnMnS
  • PnW

where:

  • nY represents the number of years,
  • nM the number of months,
  • nW the number of weeks,
  • nD the number of days,
  • 'T' is the date/time separator,
  • nH the number of hours,
  • nM the number of minutes and
  • nS the number of seconds.

The number of seconds can include decimal digits to arbitrary precision.

See the link below for more informations:

- https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#duration

Types

This section is empty.

Jump to

Keyboard shortcuts

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