the-simplifier
  • ๐Ÿ’šWelcome!
  • ๐Ÿ“ฆInstalling
  • Functions
    • The Simplifier Functions
  • ๐ŸŽซValidators
    • ๐ŸŸขisWebsiteUp
    • #๏ธโƒฃ isValidHexColor
  • ๐ŸŽกConverters
    • โฑ๏ธconvertTime
    • ๐Ÿ”ตconvertColors
  • ๐Ÿ“”Formatters
    • ๐Ÿ”ขNumberFormatter
  • ๐Ÿ“ธOCR
    • ๐Ÿ“‘๐Ÿ“ท readImage
  • โŒFakes
    • ๐ŸงชcreateFakeUser
  • ๐Ÿ”…Modified native functions
    • ๐Ÿ“œMap
  • ๐ŸŒNo category
    • ๐Ÿ”ƒgetRandomFromArray
    • ๐Ÿ” generateChars
    • ๐Ÿ”„getRandomInt
Powered by GitBook
On this page
  • Converting seconds to minutes
  • Converting seconds to hours

Was this helpful?

  1. Converters

convertTime

Convert time to another format: e.g minutes to seconds

Converting seconds to minutes

convertingTime.js
import { convertTime } from 'the-simplifier'

let convert = async() => {
  let result = await convertTime(5000, {
    from: 'seconds',
    to: 'minutes'
  })

  console.log(result)
}

convert() // Expected: 83.33333333333333
convertingTime.js
import { convertTime } from 'the-simplifier'

let convert = async() => {
  let result = await convertTime(10, {
    from: 'minutes',
    to: 'seconds'
  })

  console.log(result)
}

convert() // Expected: 600

Converting seconds to hours

convertingTime.js
import { convertTime } from 'the-simplifier'

let convert = async() => {
  let result = await convertTime(5000, {
    from: 'seconds',
    to: 'hours'
  })

  console.log(result)
}

convert() // Expected: 1.388888888888889
convertingTime.js
import { convertTime } from 'the-simplifier'

let convert = async() => {
  let result = await convertTime(1, {
    from: 'hours',
    to: 'seconds'
  })

  console.log(result)
}

convert() // Expected: 3600
convertingTime.js
import { convertTime } from 'the-simplifier'

let convert = async() => {
  let result = await convertTime(120, {
    from: 'minutes',
    to: 'hours'
  })

  console.log(result)
}

convert() // Expected: 2
convertingTime.js
import { convertTime } from 'the-simplifier'

let convert = async() => {
  let result = await convertTime(5, {
    from: 'hours',
    to: 'minutes'
  })

  console.log(result)
}

convert() // Expected: 300
PreviousConvertersNextconvertColors

Last updated 4 years ago

Was this helpful?

๐ŸŽก
โฑ๏ธ