user14586: I've run into an issue trying to combine 2 different Arduino timer projects I've found online. 
For both projects I'm using a DS3231 RTC, but have been able use the DS1307 library just fine in my code.
The first set of code I picked up started with:
#include <DS1307RTC.h>

The second set of code I tried to combine did not have this 'include', but instead used 
RTC_DS1307 RTC;

as found here:
https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/understanding-the-code
As a novice coder, I'm not really sure what the difference between the above two ways to call this library. But I do know the first way using "include", if I want to access the current time on the RTC I use 
RTC.get();

as opposed to the second method which requires:
RTC.now();

And while it was easy to find documentation to sync the RTC to computer time over the USB cable using this handy bit of code:
// Notify if the RTC isn't running
    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running");
  }



   // Get time from RTC
  DateTime current = RTC.get();
  DateTime compiled = DateTime(__DATE__, __TIME__);
  if (current.unixtime() < compiled.unixtime()) { //CHECKS AGAINST COMPUTERTIME
    Serial.println("RTC is older than compile time! Updating");
    RTC.adjust(DateTime(__DATE__, __TIME__));  //UPDATES FROM COMPUTER IF OLD TIME IS OFF
  } 

I can find no easy alternative using "#include DS1307RTC" 
I first thought that the difference between RTC.now() and RTC.get() was just a matter of word substitution. But later on when I want to use a "time_t" call after initializing with "RTC_DS1307 RTC;"
 time_t timeNOW = RTC.now();

I get the error "cannot convert 'DateTime' to 'time_t {aka long unsigned int}' in initialization"
So I'm assuming one method uses "DateTime" and one method uses "time_t". But I'm not sure if this is the case, and if so, how to convert a "DateTime" value to a "time_t" value.
I have two goals in writing this post.
1- Can someone please explain to me the difference between "#include DS1307RTC.h" and "RTC_DS1307 RTC;" and how it impacts my code.
2- I'd like to stick with using ""RTC_DS1307 RTC;", only because it seems easy to sync my RTC to my computer. But if I do, I get the above error. So can someone please tell me how to convert a "RTC now()" call to a "time_t" value? Or is the issue more complicated than just a mere conversion between data types?

user4143: A DateTime is a full class with lots of methods to it - a time_t is just an unsigned long.
time_t is used to store the number of seconds since the epoch (normally 01/01/1970)
The Arduino Time library returns a time_t to the now() function - but RTCLib return s a DateTime object.
The DateTime object, though, has a unixtime() method which will return a time_t representation of the time stored in the DateTime object.
So you can do:
DateTime dt = RTC.now();
time_t time = dt.unixtime();


14586: <p>I've run into an issue trying to combine 2 different Arduino timer projects I've found online. </p>

<p>For both projects I'm using a DS3231 RTC, but have been able use the DS1307 library just fine in my code.</p>

<p>The first set of code I picked up started with:</p>

<pre><code>#include &lt;DS1307RTC.h&gt;
</code></pre>

<p>The second set of code I tried to combine did not have this 'include', but instead used </p>

<pre><code>RTC_DS1307 RTC;
</code></pre>

<p>as found here:</p>

<p><a href="https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/understanding-the-code">https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/understanding-the-code</a></p>

<p>As a novice coder, I'm not really sure what the difference between the above two ways to call this library. But I do know the first way using "include", if I want to access the current time on the RTC I use </p>

<pre><code>RTC.get();
</code></pre>

<p>as opposed to the second method which requires:</p>

<pre><code>RTC.now();
</code></pre>

<p>And while it was easy to find documentation to sync the RTC to computer time over the USB cable using this handy bit of code:</p>

<pre><code>// Notify if the RTC isn't running
    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running");
  }



   // Get time from RTC
  DateTime current = RTC.get();
  DateTime compiled = DateTime(__DATE__, __TIME__);
  if (current.unixtime() &lt; compiled.unixtime()) { //CHECKS AGAINST COMPUTERTIME
    Serial.println("RTC is older than compile time! Updating");
    RTC.adjust(DateTime(__DATE__, __TIME__));  //UPDATES FROM COMPUTER IF OLD TIME IS OFF
  } 
</code></pre>

<p>I can find no easy alternative using "#include DS1307RTC" </p>

<p>I first thought that the difference between RTC.now() and RTC.get() was just a matter of word substitution. But later on when I want to use a "time_t" call after initializing with "RTC_DS1307 RTC;"</p>

<pre><code> time_t timeNOW = RTC.now();
</code></pre>

<p>I get the error "cannot convert 'DateTime' to 'time_t {aka long unsigned int}' in initialization"</p>

<p>So I'm assuming one method uses "DateTime" and one method uses "time_t". But I'm not sure if this is the case, and if so, how to convert a "DateTime" value to a "time_t" value.</p>

<p>I have two goals in writing this post.</p>

<p>1- Can someone please explain to me the difference between "#include DS1307RTC.h" and "RTC_DS1307 RTC;" and how it impacts my code.</p>

<p>2- I'd like to stick with using ""RTC_DS1307 RTC;", only because it seems easy to sync my RTC to my computer. But if I do, I get the above error. So can someone please tell me how to convert a "RTC now()" call to a "time_t" value? Or is the issue more complicated than just a mere conversion between data types?</p>
 4143: <p>A <code>DateTime</code> is a full class with lots of methods to it - a <code>time_t</code> is just an unsigned long.</p>

<p><code>time_t</code> is used to store the number of seconds since the <em>epoch</em> (normally 01/01/1970)</p>

<p>The Arduino <em>Time</em> library returns a <code>time_t</code> to the <code>now()</code> function - but RTCLib return s a DateTime object.</p>

<p>The DateTime object, though, has a <code>unixtime()</code> method which will return a <code>time_t</code> representation of the time stored in the DateTime object.</p>

<p>So you can do:</p>

<pre><code>DateTime dt = RTC.now();
time_t time = dt.unixtime();
</code></pre>
