anchor.diff:  %%% Some functions in this module takes atom Type as an input. It
   %%% encodes an exact datetime format; here are possible Type values:
   %%%
  -%%% * timestamp - Unix timestamp (positive integer denoting number of
  -%%%               seconds since 1 Jan 1970;
  -%%% * now       - erlang:now() format: tuple with 3 values, {MegaSeconds,
  -%%%               Seconds, MilliSeconds}, denoting number of MegaSeconds,
  -%%%               Seconds and MilliSeconds from 1 Jan 1970, respectivelly.
  -%%% * datetime  - calendar:datetime() format for GMT: tuple
  -%%%               {{Year, Month, Day}, {Hour, Minute, Seconds}}, denoting
  -%%%               GMT date and time.
  +%%% * unix     - Unix timestamp (positive integer denoting number of
  +%%%              seconds since 1 Jan 1970;
  +%%% * now      - erlang:now() format: tuple with 3 values, {MegaSeconds,
  +%%%              Seconds, MilliSeconds}, denoting number of MegaSeconds,
  +%%%              Seconds and MilliSeconds from 1 Jan 1970, respectivelly.
  +%%% * datetime - calendar:datetime() format for GMT: tuple
  +%%%              {{Year, Month, Day}, {Hour, Minute, Seconds}}, denoting
  +%%%              GMT date and time.
   %%%
   %%% There is also Format argument, which can be a binary (in the format
   %%% similar to strptime/strftime's) or one of following atoms: iso8601,
  
positive.code: -spec parse_now(format(), binary()) -> {ok, erlang:timestamp()}
                                       | {error, format_mismatch}.
  parse_now(Format, Bin) ->
      Timestamp = parse_timestamp(Format, Bin),
      MegaSecs = Timestamp div ?M,
      Secs = Timestamp rem ?M,
      {MegaSecs, Secs, 0}.
  
negative.code:                                | {error, invalid_time}.
  format(Format, Datetime, Type) ->
      case Type of
          unix     -> format_unix(Format, Datetime);
          now      -> format_now(Format, Datetime);
          datetime -> format_datetime(Format, Datetime)
      end.
  
  %% @doc Helper function similar to format/3.
  %%      @equiv format(Format, Datetime, timestamp)
  %% @end
  -spec format_unix(format(), unix_timestamp()) -> {ok, binary()}
                                                 | {error, invalid_time}.
  format_unix(Format, Timestamp) ->
      strftime(convert_format(Format), Timestamp).
  
  %% @doc Helper function similar to format/3.
  