       # to Gregorian seconds
       iex> NaiveDateTime.diff(~N[2014-10-02 00:29:10], ~N[0000-01-01 00:00:00])
       63579428950
+
   """
   @spec diff(t, t, System.time_unit) :: integer
   def diff(%NaiveDateTime{} = naive_datetime1,

      18000

  """
  @spec diff(DateTime.t, DateTime.t) :: Calendar.rata_die
  def diff(%DateTime{utc_offset: utc_offset1, std_offset: std_offset1} = datetime1,
           %DateTime{utc_offset: utc_offset2, std_offset: std_offset2} = datetime2, unit \\ :seconds) do
    {days1, {parts1, ppd1}} =

      -2

  """
  @spec diff(Date.t, Date.t) :: integer
  def diff(%Date{} = date1, %Date{} = date2) do
    if Calendar.compatible_calendars?(date1.calendar, date2.calendar) do
      {days1, _} = to_rata_die(date1)
