Skip to content
Advertisement

Converts minutes into days, week, months and years

Let’s suppose I have a number which represents the minutes passed from the start time to now.

I wan to create a function which returns the years, months, week and days corresponding to the minutes I am passing to that function.

Here an example:

JavaScript

What is the best way to achieve the result?

Advertisement

Answer

Maybe like this?

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement