New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

secondstohms

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secondstohms

Package to convert seconds to time format (HH:MM:SS)

latest
npmnpm
Version
1.2.5
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

secondstohms

![npm]

This package converts seconds to a time format (HH:MM:SS) for initial few releases we are only going to return HH:MM:SS format but for later releases we can send different formats to the client

how to use this package:

📦 Install

npm install secondstohms
yarn add secondstohms

🔨 Usage

convertSecondsToHMS: currently we only have one method to require

const { convertSecondsToHMS } = require("secondstohms");

const hms = convertSecondsToHMS(3600);

// displays 01 : 00 : 00
console.log(hms);

// second boolean argument is to get hours and minutes and seconds in an object
// for easy access to separate values
const hms_duplicate = convertSecondsToHMS(9581, true);
// displays { hours: 2, minutes: 39, seconds: 41 }
console.log(hms_duplicate);

🔨 Usage in modules

import { convertSecondsToHMS } from "secondstohms";
const hms = convertSecondsToHMS(3600);

// displays 01 : 00 : 00
console.log(hms);

// second boolean argument is to get hours and minutes and seconds in an object
// for easy access to separate values
const hms_duplicate = convertSecondsToHMS(9581, true);
// displays { hours: 2, minutes: 39, seconds: 41 }
console.log(hms_duplicate);

🔨 To get hours and minutes separately

can be used as javascript modules as shown below

import { convertToHours, convertToMinutes } from "secondstohms";

const hours = convertToHours(7200);
const minutes = convertToMinutes(7200);

// displays 2 (2 hours)
console.log(hours);
// displays 120 (120 minutes)
console.log(minutes);

publisher

Mantiqh Technologies

Keywords

secondstohms

FAQs

Package last updated on 05 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts