<?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[boost: Aktuelle Minuten&#x2F;Sekunden&#x2F;Stunden]]></title><description><![CDATA[<p>Wieso liefert folgendes das aktuelle Datum:</p>
<pre><code>boost::gregorian::date d = boost::gregorian::day_clock::universal_day(); 
d.year()
d.month()
d.day()
</code></pre>
<p>Und folgendes nicht die aktuelle Zeit:</p>
<pre><code>boost::posix_time::ptime t = boost::posix_time::second_clock::universal_time(); 
// Folgende Methoden existieren nicht
t.hours()
t.minutes()
t.seconds();
</code></pre>
<p>Ja wie komme ich denn jetzt an die aktuellen Minuten Sekunden und Stunden. Selbst meine professionellen google-Kenntnisse bringen mich kein Stück weiter, nein die Doku ist keine Hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/313934/boost-aktuelle-minuten-sekunden-stunden</link><generator>RSS for Node</generator><lastBuildDate>Sat, 01 Aug 2026 19:23:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/313934.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Feb 2013 16:00:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost: Aktuelle Minuten&#x2F;Sekunden&#x2F;Stunden on Thu, 14 Feb 2013 16:00:39 GMT]]></title><description><![CDATA[<p>Wieso liefert folgendes das aktuelle Datum:</p>
<pre><code>boost::gregorian::date d = boost::gregorian::day_clock::universal_day(); 
d.year()
d.month()
d.day()
</code></pre>
<p>Und folgendes nicht die aktuelle Zeit:</p>
<pre><code>boost::posix_time::ptime t = boost::posix_time::second_clock::universal_time(); 
// Folgende Methoden existieren nicht
t.hours()
t.minutes()
t.seconds();
</code></pre>
<p>Ja wie komme ich denn jetzt an die aktuellen Minuten Sekunden und Stunden. Selbst meine professionellen google-Kenntnisse bringen mich kein Stück weiter, nein die Doku ist keine Hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2298904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298904</guid><dc:creator><![CDATA[N-E-R-V]]></dc:creator><pubDate>Thu, 14 Feb 2013 16:00:39 GMT</pubDate></item><item><title><![CDATA[Reply to boost: Aktuelle Minuten&#x2F;Sekunden&#x2F;Stunden on Thu, 14 Feb 2013 17:00:53 GMT]]></title><description><![CDATA[<p>N-E-R-V schrieb:</p>
<blockquote>
<p>nein die Doku ist keine Hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
</blockquote>
<p>Das ist doof...</p>
<p>Was ich jetzt dieser unnützen Dokumentation entnommen habe ist, dass ich mir die Funktionalität ziemlich lapidar selber schreiben kann.</p>
<pre><code class="language-cpp">int hour(const boost::posix_time::ptime&amp; pt){ return to_tm(pt).tm_hour; }
int min(const boost::posix_time::ptime&amp; pt){ return to_tm(pt).tm_min; }
int sec(const boost::posix_time::ptime&amp; pt){ return to_tm(pt).tm_sec; }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2298916</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298916</guid><dc:creator><![CDATA[Furble Wurble]]></dc:creator><pubDate>Thu, 14 Feb 2013 17:00:53 GMT</pubDate></item><item><title><![CDATA[Reply to boost: Aktuelle Minuten&#x2F;Sekunden&#x2F;Stunden on Thu, 14 Feb 2013 17:26:36 GMT]]></title><description><![CDATA[<p>Ohne es zu überprüfen, sollte Folgendes funktionieren (hab ich aus altem Code von mir geklaut):</p>
<pre><code class="language-cpp">posix_time::ptime foo = ...;
gregorian::date datePart = foo.date();
posix_time::time_duration timePart = foo.time_of_day();
auto year = datePart.year();
auto month = datePart.month();
auto day = datePart.day();
auto hours = timePart.hours();
auto minutes = timePart.minutes();
auto seconds = timePart.seconds();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2298922</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298922</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Thu, 14 Feb 2013 17:26:36 GMT</pubDate></item><item><title><![CDATA[Reply to boost: Aktuelle Minuten&#x2F;Sekunden&#x2F;Stunden on Thu, 14 Feb 2013 19:04:24 GMT]]></title><description><![CDATA[<p>Ich habe das bei mir so gemacht (in einem namespace):</p>
<pre><code>boost::posix_time::ptime now()
	{
		return boost::posix_time::second_clock::universal_time();
	}

//...
std::cout &lt;&lt; now().date() &lt;&lt; &quot; oder: &quot; &lt;&lt; now().time_of_day();
</code></pre>
<p>wobei die beiden letzten Funktionen nach Bedarf in einzelne Elemente zerlegt werden können. Ich stimme dir voll und ganz zu, dass die Doku und die Anwendung anfangs nicht einfach zu knacken ist. Man muss sich erstmal durch 10 Namensräume durchbeißen, um an so etwas einfaches wie die lokale Zeit oder Zeitdifferenz in Milisekunden zu kommen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2298941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2298941</guid><dc:creator><![CDATA[*Rewind*]]></dc:creator><pubDate>Thu, 14 Feb 2013 19:04:24 GMT</pubDate></item></channel></rss>