Convert seconds to minutes using JavaScript



In this simple JavaScript example, we take a look at how to convert seconds to minutes.


Example:

const seconds = 185;
const minutes = Math.floor(seconds / 60);
const remainingSeconds = seconds % 60;
console.log(seconds + " seconds is " + minutes + " minutes and " + remainingSeconds + " seconds");
Output:

185 seconds is 3 minutes and 5 seconds

JavaScript seconds to minutes example
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap