hhmmss

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2019 License: Apache-2.0 Imports: 2 Imported by: 6

README

HH:MM:SS

Parse HH:MM:SS strings into a Go time.Duration type.

Installation

Install this package with:

go get github.com/dannav/hhmmss

Usage

Given the following string 03:30:26 call the package's Parse method:

dur, err := Parse("03:30:26")

Parse returns a time.Duration value that allows you to retrieve the value's time in seconds, hours, minutes, etc.

If an integer string is passed to Parse the argument will be treated as seconds.

Examples

View the tests for more examples on using hhmmss.

Documentation

Overview

Package hhmmss manages converting HH:MM:SS time strings to time.Duration values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(value string) (time.Duration, error)

Parse converts a given stopwatch time string to a time.Duration value. The argument should be in the format HH:MM:SS or MM:SS. If the argument does not contain any colons (i.e. 1200), the argument is parsed as seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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