Skip to content

Instantly share code, notes, and snippets.

@nenadg
Created February 5, 2016 09:01
Show Gist options
  • Save nenadg/a4e39d15785223e32945 to your computer and use it in GitHub Desktop.
Save nenadg/a4e39d15785223e32945 to your computer and use it in GitHub Desktop.
some seconds to horus, days, weeks, etc. conversion
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