anchor.diff:           timestamp_to_ms/1,
            ms_to_timestamp/1]).
   
  -%% @doc A timestamp in millisconds representing number of millisconds from Unix epoch
   -type time_ms() :: non_neg_integer().
  -
  -%% @doc The units of quantization available to quanta/3
  +%% A timestamp in millisconds representing number of millisconds from Unix epoch
  +
   -type time_unit() :: y | mo | d | h | m | s.
  +%%  The units of quantization available to quanta/3
   
   -type err() :: {error, term()}.
   
  
positive.code:     {error, {invalid_unit, Unit}}.
  
  %% @doc Return the time in milliseconds since 00:00 GMT Jan 1, 1970 (Unix Epoch)
  %% This accounts for leap years. Yay!
  -spec years_since_1970_to_ms(non_neg_integer()) -> time_ms().
  years_since_1970_to_ms(Year) ->
  
negative.code:                               io:format(user, Str, Args) end, P)).
  -compile(export_all).
  -endif.
  -endif.
  %% @clear
  %% @end
  
  %% @doc Given the time in milliseconds since the unix epoch and a time range and unit eg (15, m),
  %% generate the starting timestamp of the range (quanta) in milliseconds since the epoch where the
  %% time belongs. Note that Time - Quanta is less than or equal to QuantaSize * Unit (in milliseconds).
  -spec quanta(time_ms(), non_neg_integer(), time_unit()) -> time_ms() | err().
  quanta(Time, QuantaSize, Unit) when Unit == d; Unit == h; Unit == m; Unit == s ->
      Ms = unit_to_ms(Unit),
  