LowEndInsight v0.3.3 TimeHelper View Source

Collection of functions for handling time-based conversions.

Link to this section Summary

Functions

get_commit_delta/1: returns the time between now and the last commit in seconds

sec_to_days/1: returns a roll-up of days from a number of secs

sec_to_str/1: returns a string breakdown of total seconds into weeks, days, hours, minutes and remaining seconds.

sec_to_weeks/1: returns a roll-up of weeks from a number of secs

sum_ts_diff/1

Link to this section Functions

Link to this function

get_commit_delta(last_commit_date)

View Source

get_commit_delta/1: returns the time between now and the last commit in seconds

sec_to_days/1: returns a roll-up of days from a number of secs

sec_to_str/1: returns a string breakdown of total seconds into weeks, days, hours, minutes and remaining seconds.

Examples

  iex> TimeHelper.sec_to_str(5211)
  "1 hr, 26 min, 51 sec"

sec_to_weeks/1: returns a roll-up of weeks from a number of secs

sum_ts_diff/1

Link to this function

sum_ts_diff(list, accumulator)

View Source

sum_ts_diff/2