Suppose I have a number that represents the minutes elapsed from launch to the present.
I wanted to create a function that returns the years, months, week, and days that correspond to the protocols that I pass to this function.
Here is an example:
var minutes = 635052; // 635052 = (24*60)*365 + (24*60)*30*2 + (24*60)*14 + (24*60)*2 + 12; getDataHR(minutes); // 1 year, 2 months, 2 week, 2 days, 12 minutes function getDataHR (newMinutes) { minutes = newMinutes; ....... return hrData; // 1 year, 2 months, 2 week, 2 days, 12 minutes }
What is the best way to achieve a result?
antonjs
source share