user43638: I'm trying to use an if statement to check when the time goes past a specific point and run a specific function. To do this I'm looking to convert time into a double and running something along the lines of if(timeCurrent >= 8.30). I seem to however have an issue with the conversion part, normally I'm aware the standard practice in C++ would be to do the following:  
DateTime now = rtc.now();
static char buffer[80];

sprintf(buffer, "%02d.%02d", now.hour(), now.minute());
String str(buffer);
double timeCurrent = strtod(str);

However, this doesn't work for Arduino. What can be done to create the same desired function?

user7508: Don't do that. Converting a time to double is highly inefficient.
Moreover, your approach suffers from a rollover issue every 24h.
If you just want to compare the time of day with 8:30, you can do it in
a very straightforward way:
if (now.hour() > 8 || (now.hour() == 8 && now.minute() >= 30))

If the long if annoys you, you can put the comparison logic inside a
static inline function. If you really want to combine hour and minute
into a single number, then convert to an integer rather than a double:
if (now.hour() * 100 + now.minute() >= 830)

This can be made more efficient if you think in binary rather than
decimal: you can build a 16-bit number with one byte holding the hours
and the other byte holding the minutes:
if ((now.hour() << 8) | now.minute() >= (8 << 8) | 30)

Again, you may encapsulate the ((a)<<8|(b)) in a macro or static
inline function if it helps with readability. If you want to compare to
an absolute time, your best option is to build a DateTime object
representing the deadline, and compare with now as:
// Assume timeout should be today at 8:30.
DateTime timeout(now.year(), now.month(), now.day(), 8, 30, 0);
if (now.secondstime() >= timeout.secondstime())

Here the secondstime() method is used to convert the DateTime into a
scalar number (a 32-bit integer of type time_t) that can be easily
compared and is far more efficient than using floats.

43638: <p>I'm trying to use an if statement to check when the time goes past a specific point and run a specific function. To do this I'm looking to convert time into a double and running something along the lines of <code>if(timeCurrent &gt;= 8.30)</code>. I seem to however have an issue with the conversion part, normally I'm aware the standard practice in C++ would be to do the following:  </p>

<pre><code>DateTime now = rtc.now();
static char buffer[80];

sprintf(buffer, "%02d.%02d", now.hour(), now.minute());
String str(buffer);
double timeCurrent = strtod(str);
</code></pre>

<p>However, this doesn't work for Arduino. What can be done to create the same desired function?</p>
 7508: <p>Don't do that. Converting a time to <code>double</code> is highly inefficient.
Moreover, your approach suffers from a rollover issue every 24h.</p>

<p>If you just want to compare the time of day with 8:30, you can do it in
a very straightforward way:</p>

<pre><code>if (now.hour() &gt; 8 || (now.hour() == 8 &amp;&amp; now.minute() &gt;= 30))
</code></pre>

<p>If the long <code>if</code> annoys you, you can put the comparison logic inside a
<code>static inline</code> function. If you really want to combine hour and minute
into a single number, then convert to an integer rather than a double:</p>

<pre><code>if (now.hour() * 100 + now.minute() &gt;= 830)
</code></pre>

<p>This can be made more efficient if you think in binary rather than
decimal: you can build a 16-bit number with one byte holding the hours
and the other byte holding the minutes:</p>

<pre><code>if ((now.hour() &lt;&lt; 8) | now.minute() &gt;= (8 &lt;&lt; 8) | 30)
</code></pre>

<p>Again, you may encapsulate the <code>((a)&lt;&lt;8|(b))</code> in a macro or static
inline function if it helps with readability. If you want to compare to
an absolute time, your best option is to build a <code>DateTime</code> object
representing the deadline, and compare with <code>now</code> as:</p>

<pre><code>// Assume timeout should be today at 8:30.
DateTime timeout(now.year(), now.month(), now.day(), 8, 30, 0);
if (now.secondstime() &gt;= timeout.secondstime())
</code></pre>

<p>Here the <code>secondstime()</code> method is used to convert the <code>DateTime</code> into a
scalar number (a 32-bit integer of type <code>time_t</code>) that can be easily
compared and is far more efficient than using floats.</p>
