Created
February 5, 2016 09:01
-
-
Save nenadg/a4e39d15785223e32945 to your computer and use it in GitHub Desktop.
some seconds to horus, days, weeks, etc. conversion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convert(seconds){ | |
seconds = seconds || 3600; | |
var minutes = (seconds / 60), | |
hours = (minutes / 60), | |
days = (hours / 24), | |
weeks = (days / 7), | |
months = (days / 30), | |
years = (days / 365), | |
quarters = (days / 90);// % 4; | |
return { | |
years: years, | |
quarters: quarters, | |
months: months, | |
weeks: weeks, | |
days: days, | |
hours: hours, | |
minutes: minutes, | |
seconds: seconds | |
} | |
} | |
convert() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment