user4599: For some reason I can't use the Time.h lib.
Can you guys tell me how to create a string from the datetime into a format like this:
yyyy.MM.dd:hh.mm.ss
2014.10.29:07.12.33

Seems odd that I can't find any examples of this.

user4613: There's no built in function to do that, I'm afraid.
I suggest you create a method that will format the string like so. Something along the lines of: 
void formatTime()
{
   string str = year() + "." + month() + "." + day() + ":" + hour() + "FILL IN THE REST";
}


user56298: Is that what you want, mate?
char buf1[20];
DateTime now = rtc.now(); 
//Updated now.day to now.date
sprintf(buf1, "%02d:%02d:%02d %02d/%02d/%02d",  now.hour(), now.minute(), now.second(), now.date(), now.month(), now.year()); 

Serial.print(F("Date/Time: "));
Serial.println(buf1);


user55899: If by DateTime you are referring to RTClib's DateTime (this is something you have to clarify in your question), then you can call unixtime() method on your DateTime object. The returned value is regular Unix "epoch" time, which can be used as time_t value with functions from <time.h> (and it's <time.h>, not <Time.h>).
For example, you can use ctime to convert Unix time_t value to a C-string, although the format of that string is different from the one you requested
DateTime dt;
...
time_t t = dt.unixtime();

const char *str = ctime(&t);
Serial.println(str);

On Arduino you also have ctime_r available to you as a reentrant version of ctime.
Or, if you need more flexibility with the format, you can use gmtime or localtime and then strftime, but this might be excessive, since struct tm generated by gmtime is in essence very similar to DateTime. You can simply use snprintf in a manner suggested in @şevket Karayılan's answer. 
Nevertheless, note that strftime provides you with quite extensive formatting capabilities, which would take some effort to reimplement manually
DateTime dt;
...
time_t t = dt.unixtime();
struct tm *lt = localtime(&t);

char str[32];
strftime(str, sizeof str, "%Y.%m.%d:%H.%M.%S", lt); 
Serial.println(str);

strftime(str, sizeof str, "%x %X", lt); 
Serial.println(str);

strftime(str, sizeof str, "%F %T", lt); 
Serial.println(str);


4599: <p>For some reason I can't use the <code>Time.h</code> lib.</p>

<p>Can you guys tell me how to create a string from the datetime into a format like this:</p>

<pre><code>yyyy.MM.dd:hh.mm.ss
2014.10.29:07.12.33
</code></pre>

<p>Seems odd that I can't find any examples of this.</p>
 4613: <p>There's no built in function to do that, I'm afraid.</p>

<p>I suggest you create a method that will format the string like so. Something along the lines of: </p>

<pre><code>void formatTime()
{
   string str = year() + "." + month() + "." + day() + ":" + hour() + "FILL IN THE REST";
}
</code></pre>
 56298: <p>Is that what you want, mate?</p>
<pre><code>char buf1[20];
DateTime now = rtc.now(); 
//Updated now.day to now.date
sprintf(buf1, &quot;%02d:%02d:%02d %02d/%02d/%02d&quot;,  now.hour(), now.minute(), now.second(), now.date(), now.month(), now.year()); 

Serial.print(F(&quot;Date/Time: &quot;));
Serial.println(buf1);
</code></pre>
 55899: <p>If by <code>DateTime</code> you are referring to RTClib's <a href="https://github.com/adafruit/RTClib/blob/master/RTClib.h#L30" rel="nofollow noreferrer"><code>DateTime</code></a> (this is something you have to clarify in your question), then you can call <a href="https://github.com/adafruit/RTClib/blob/master/RTClib.h#L49" rel="nofollow noreferrer"><code>unixtime()</code></a> method on your <code>DateTime</code> object. The returned value is regular Unix "epoch" time, which can be used as <code>time_t</code> value with functions from <code>&lt;time.h&gt;</code> (and it's <code>&lt;time.h&gt;</code>, not <code>&lt;Time.h&gt;</code>).</p>

<p>For example, you can use <a href="https://en.cppreference.com/w/cpp/chrono/c/ctime" rel="nofollow noreferrer"><code>ctime</code></a> to convert Unix <code>time_t</code> value to a C-string, although the format of that string is different from the one you requested</p>

<pre><code>DateTime dt;
...
time_t t = dt.unixtime();

const char *str = ctime(&amp;t);
Serial.println(str);
</code></pre>

<p>On Arduino you also have <code>ctime_r</code> available to you as a reentrant version of <code>ctime</code>.</p>

<p>Or, if you need more flexibility with the format, you can use <code>gmtime</code> or <code>localtime</code> and then <a href="https://en.cppreference.com/w/cpp/chrono/c/strftime" rel="nofollow noreferrer"><code>strftime</code></a>, but this might be excessive, since <code>struct tm</code> generated by <code>gmtime</code> is in essence very similar to <code>DateTime</code>. You can simply use <code>snprintf</code> in a manner suggested in @şevket Karayılan's answer. </p>

<p>Nevertheless, note that <code>strftime</code> provides you with quite extensive formatting capabilities, which would take some effort to reimplement manually</p>

<pre><code>DateTime dt;
...
time_t t = dt.unixtime();
struct tm *lt = localtime(&amp;t);

char str[32];
strftime(str, sizeof str, "%Y.%m.%d:%H.%M.%S", lt); 
Serial.println(str);

strftime(str, sizeof str, "%x %X", lt); 
Serial.println(str);

strftime(str, sizeof str, "%F %T", lt); 
Serial.println(str);
</code></pre>
