<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Zeit einzelnt ausgeben]]></title><description><![CDATA[<p>Hi, wie kann man die Zeit einzelnt ausgeben? also die Sekunden kommen in eine eigende Variable, das Jahr kommt auch in eine eigene Variable, ...</p>
<p>BD</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/326869/zeit-einzelnt-ausgeben</link><generator>RSS for Node</generator><lastBuildDate>Sun, 31 May 2026 00:20:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326869.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Jul 2014 20:11:59 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zeit einzelnt ausgeben on Thu, 10 Jul 2014 20:11:59 GMT]]></title><description><![CDATA[<p>Hi, wie kann man die Zeit einzelnt ausgeben? also die Sekunden kommen in eine eigende Variable, das Jahr kommt auch in eine eigene Variable, ...</p>
<p>BD</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408098</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408098</guid><dc:creator><![CDATA[TimePoint]]></dc:creator><pubDate>Thu, 10 Jul 2014 20:11:59 GMT</pubDate></item><item><title><![CDATA[Reply to Zeit einzelnt ausgeben on Thu, 10 Jul 2014 20:18:07 GMT]]></title><description><![CDATA[<p>Schau dir mal die chrono Bibliothek an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408100</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408100</guid><dc:creator><![CDATA[Mr.Zeit]]></dc:creator><pubDate>Thu, 10 Jul 2014 20:18:07 GMT</pubDate></item><item><title><![CDATA[Reply to Zeit einzelnt ausgeben on Thu, 10 Jul 2014 20:35:48 GMT]]></title><description><![CDATA[<p>Ich komme mit der Klasse nicht wirklich klar ... oder ich mache was falsch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408105</guid><dc:creator><![CDATA[TimePoint]]></dc:creator><pubDate>Thu, 10 Jul 2014 20:35:48 GMT</pubDate></item><item><title><![CDATA[Reply to Zeit einzelnt ausgeben on Thu, 10 Jul 2014 21:10:37 GMT]]></title><description><![CDATA[<p>TimePoint schrieb:</p>
<blockquote>
<p>Ich komme mit der Klasse nicht wirklich klar ... oder ich mache was falsch</p>
</blockquote>
<p>Deine Analyse ist korrekt.</p>
<p>Wenn du weniger Antworten dieser Art möchtest, dann lies:<br />
<a href="http://www.c-plusplus.net/forum/200753" rel="nofollow">http://www.c-plusplus.net/forum/200753</a><br />
Und in diesem Fall wohl noch viel wichtiger:<br />
<a href="http://www.tty1.net/smart-questions_de.html" rel="nofollow">http://www.tty1.net/smart-questions_de.html</a></p>
<p>P.S.: Vielleicht liegen dir die <a href="http://en.cppreference.com/w/cpp/chrono/c" rel="nofollow">alten C-Funktionen</a> eher? Benutzung auf eigene Gefahr. (Wobei ich zugeben muss, dass ich chrono nicht wirklich für gelungen halte. Ist zwar schick für Zeitunterschiede, aber anscheinend hat die Bibliothek auch den Anspruch, für Datum und Uhrzeit Funktionalität zur Verfügung zu stellen. Dieser Teil ist jedoch arg umständlich)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408110</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 10 Jul 2014 21:10:37 GMT</pubDate></item><item><title><![CDATA[Reply to Zeit einzelnt ausgeben on Fri, 11 Jul 2014 15:58:49 GMT]]></title><description><![CDATA[<blockquote>
<p>Hi, wie kann man die Zeit einzelnt ausgeben? also die Sekunden kommen in eine eigende Variable, das Jahr kommt auch in eine eigene Variable, ...</p>
</blockquote>
<p>Das sind erstmal zwei verschiedene Dinge. Du musst dir klar machen dass man ersteres ohne letzteres erreichen kann.<br />
(i.A. fasst man die einzelnen Bestandteile eines Datums gar nicht selber an sondern überlässt das den Bibliotheken wie <a href="http://www.boost.org/doc/libs/1_55_0/doc/html/date_time.html" rel="nofollow">Boost.Date_Time</a>)</p>
<p>Genau das machen formatierte Ausgabefunktionen wie<a href="http://en.cppreference.com/w/cpp/io/manip/put_time" rel="nofollow"> <code>std::put_time</code> </a>(welche mit dem C++11-Standard eingeführt wurde),<a href="http://en.cppreference.com/w/cpp/chrono/c/asctime" rel="nofollow"> <code>std::asctime</code> </a>oder<a href="http://en.cppreference.com/w/cpp/chrono/c/ctime" rel="nofollow"> <code>ctime</code> </a>:</p>
<pre><code>#include &lt;iostream&gt;// Für cout.
#include &lt;iomanip&gt; // put_time ist in diesem Header deklariert.
#include &lt;ctime&gt;   // Für std:: localtime, time, asctime und ctime.

int main()
{
	std::time_t t = std::time(nullptr); // Gibt die Anzahl der Sekunden seit der Epoche (1. Januar 1970) zurück. std::time_t ist ein Ganzzahltyp.
	std::cout &lt;&lt; std::put_time(std::localtime(&amp;t), &quot;%c&quot;) &lt;&lt; '\n'; // Der Formatstring kann auch Stunden, Monatsnamen oder Zeitzonennamen repräsentieren
	std::cout &lt;&lt; std::asctime(std::localtime(&amp;t)) &lt;&lt; '\n';
	std::cout &lt;&lt; std::ctime(std::localtime(&amp;t)) &lt;&lt; '\n';
	// Selbstverständlich kann das Ergebnis von localtime auch zwischengespeichert werden (sowohl Pointer als auch Pointee).
}
</code></pre>
<p>Der Rückgabewert von <code>localtime</code> enthält übrigens die Variablen von denen du sprichst. Es ist ein Zeiger auf eine Datenstruktur namens<a href="http://en.cppreference.com/w/cpp/chrono/c/tm" rel="nofollow"> <code>std::tm</code> </a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408163</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408163</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Fri, 11 Jul 2014 15:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to Zeit einzelnt ausgeben on Fri, 11 Jul 2014 11:15:29 GMT]]></title><description><![CDATA[<p><a href="http://www.duden.de/" rel="nofollow">Das</a> solltest Du Dir mal anschauen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2408172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2408172</guid><dc:creator><![CDATA[besserwisser]]></dc:creator><pubDate>Fri, 11 Jul 2014 11:15:29 GMT</pubDate></item></channel></rss>