   @doc ~S"""
   Convert a unix timestamp to excel time.
   """
-  @spec to_excel_datetime(number) :: number
+  @spec to_excel_datetime(number) :: {:excelts, number}
   def to_excel_datetime(input) when is_number(input) do
     to_excel_datetime(
       :calendar.now_to_universal_time({div(input, 1000000), rem(input, 1000000), 0}))


  @doc ~S"""
  Convert an erlang :calendar object to an excel timestamp.

  TODO: Might be better to return a tuple {:excelts, <value>}
  here to avoid confusion with unix timestmaps. Same below.
  """
  @spec to_excel_datetime(datetime_t) :: number
  def to_excel_datetime({{yy, mm, dd}, {h, m, s}}) do
    in_seconds = :calendar.datetime_to_gregorian_seconds {{yy, mm, dd}, {h, m, s}}
    excel_epoch = :calendar.datetime_to_gregorian_seconds @excel_epoch

  Timestampts that are already in excel format are passed through
  unmodified.
  """
  @spec to_excel_datetime({:excelts, number}) :: {:excelts, number}
  def to_excel_datetime({:excelts, value}) do
    {:excelts, value}
  end
