machine2human

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: MIT Imports: 5 Imported by: 0

README

machine2human

Package machine2human help you convert seconds to readble string and vice verca.

Installation

  1. The first need Go installed.
go get -u github.com/miolex/machine2human
  1. Import it in your code
import "github.com/miolex/machine2human"

Quick start

package main

import (
	"fmt"

	"github.com/miolex/machine2human"
)

func main() {
	fmt.Println(machine2human.Sec2Hum(228))
	fmt.Print(machine2human.Hum2Sec("12 минут"))
}
$ go run example.go
3 минуты 48 секунд
720

Documentation

Overview

Package machine2human help you convert seconds to readble string and vice verca

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hum2Sec

func Hum2Sec(input string) int

Hum2Sec implement convertation readable string to seconds

func Sec2Hum

func Sec2Hum(seconds int) string

Sec2Hum implement convertation secons to readable string

Types

This section is empty.

Jump to

Keyboard shortcuts

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