UNPKG

min-2-hr

Version:

A simple utility to convert minutes to a 24-hour or 12-hour time format with day indication.

38 lines (18 loc) 818 B
# Time Converter A simple utility to convert minutes to a 24-hour or 12-hour time format with day indication. ## Installation ## Usage To use this package, first import it into your project: ## JavaScript const Min2Hrs = require('min-2-hr'); Then, you can use the following methods to convert minutes to time formats: ## Convert to 24-Hour Format let time24 = Min2Hrs.minuteTo24HrTime(1600); console.log(time24); // Output: "02:40 +1 day" ## Convert to 12-Hour Format let time12 = Min2Hrs.minutesTo12HrTime(1600); console.log(time12); // Output: "02:40 AM +1 day" Replace 1600 with the number of minutes you want to convert. If no value is provided, the default value is 12. Feel free to customize the usage according to your needs. ```bash npm install min-2-hr