Skip to content

byClebert/ToTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ToTime

This is a time conversion package.

INSTALL

npm i @clebertsfigueiredo/totime

IMPORT

const totime = require('@clebertsfigueiredo/totime')
// or
import totime from '@clebertsfigueiredo/totime'

USE

const { minutesToHours } = require('@clebertsfigueiredo/totime')

const response = minutesToHours(85)

console.log(response) // '01:25'

METHODS

const {
    intervalInMinutes,
    minutesToHours,
    secondsToHours,
    secondsToMinutes,
    timeToMinutes,
    timeToSeconds 
} = require('@clebertsfigueiredo/totime')

// Gets the interval in minutes
intervalInMinutes('14:10', '14:30') // Output: 20

// Transform minutes into hours
minutesToHours(125) // Output: '02:05'

// Transform seconds into hours
secondsToHours(10860) // Output: '03:01'
secondsToHours(14465) // Output: '04:01:05'

// Transform seconds into minutes
secondsToMinutes(60) // Output: '01' **minutes
secondsToMinutes(75) // Output: 01:15 **PS.: <minutes>:<seconds>, does not return the time

// Transform time to minutes
timeToMinutes('02:00') // Output: 120

// Transform time to seconds
timeToSeconds('02:00') // Output: 7200

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published