<?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[Datum in Unixtimestamp wandeln]]></title><description><![CDATA[<p>Hey</p>
<p>Ich möchte gerne ein Datum, welches mir in 3 Integern (day, month, year) vorliegt, in einen Unixtimestamp, also die Sekunden seit 1970 wandeln.<br />
Als Uhrzeit kann 00:00 angenommen werden.</p>
<p>Meine Frage ist:<br />
Bietet die C oder die C++ Standardbibliothek dafür eine Möglichkeit oder muss ich das selber mühsam umrechnen? Bzw gibt es da schon vorgefertigt eine simple Methode?</p>
<p>viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/222146/datum-in-unixtimestamp-wandeln</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 06:54:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/222146.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Sep 2008 13:56:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Datum in Unixtimestamp wandeln on Mon, 08 Sep 2008 13:56:10 GMT]]></title><description><![CDATA[<p>Hey</p>
<p>Ich möchte gerne ein Datum, welches mir in 3 Integern (day, month, year) vorliegt, in einen Unixtimestamp, also die Sekunden seit 1970 wandeln.<br />
Als Uhrzeit kann 00:00 angenommen werden.</p>
<p>Meine Frage ist:<br />
Bietet die C oder die C++ Standardbibliothek dafür eine Möglichkeit oder muss ich das selber mühsam umrechnen? Bzw gibt es da schon vorgefertigt eine simple Methode?</p>
<p>viele Grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1578655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1578655</guid><dc:creator><![CDATA[Timestamp]]></dc:creator><pubDate>Mon, 08 Sep 2008 13:56:10 GMT</pubDate></item><item><title><![CDATA[Reply to Datum in Unixtimestamp wandeln on Mon, 08 Sep 2008 16:45:52 GMT]]></title><description><![CDATA[<p>das einfachste ist, wenn du dein datum in eine &quot;struct tm&quot; packst (das ist standard c/c++) und diese dann mittels mktime() (das müsste posix sein) in die posix-variante time_t überführst. time_t ist nur ein typedef auf einen int.<br />
sieht dann so aus:</p>
<pre><code class="language-cpp">struct tm time_tm; //das temporäre objekt
   time_t time_unix; //das ziel
   time_tm.tm_year = year - 1900;
   time_tm.tm_mon = month; //achtung januar == 0
   time_tm.tm_mday = day;
//die hier müssen gesetzt werden, sonst kann das zu problemen führen
   time_tm.tm_hour = 0;
    time_tm.tm_min = 0;
    time_tm.tm_sec = 1;
    time_tm.tm_isdst = -1; //daylight-saving == unknown. 
//heißt: das system soll gefällig selber rausbekommen, ob zu dem zeitpunkt nötig oder nicht.
//klappt daher nur für die lokale zeitzone.

   time_unix = mktime(&amp;time_tm);
   if (time_unix == -1)
	[hier fehler]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1578752</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1578752</guid><dc:creator><![CDATA[ghorst]]></dc:creator><pubDate>Mon, 08 Sep 2008 16:45:52 GMT</pubDate></item></channel></rss>