<?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[TimeStamp in long auslesen bzw. bearbeiten]]></title><description><![CDATA[<p>Hallo liebe C++ler,</p>
<p>Ich arbeite gerade an einen Projekt wo ich die Kalenderdaten eines Programms (David.fx) auf einer Internetseite Veröffentlichen will. Klappt auch ganz gut bis jetzt, das ein zigste was mir jetzt noch fehlt ist die Zeit/Datum anzeige.</p>
<p>Ich bekomme aus einer Datei (archive.dat) die Daten über einen von Hersteller vorgegeben struct ausgelesen. In diesen struct ist die Anfangs und die Endzeit des Termins in long gespeichert (z.B. StatusTime: 1285062033, SendTime: 1285236000, StopTime: 1285246800).<br />
hier ein Ausschnitt des structs:</p>
<pre><code class="language-cpp">long     StatusTime;           //Time of the log according to
                                 //the status, and the time is
                                 //coded as UCT (Unsiversal
                                 //Coordinated Time). Represents
                                 //a counter of secondes since
                                 //00:00:00 1.Jan.1970
  long     SendTime;             //Sending date for the job.
								 //Definitions are in the following
								 //table:
  #define ST_IMMEDIATE    -1
  #define ST_NIGHT        -2
  #define xST_DY          (-10)
  #define xST_DY_IMMEDIATE (-10)
  #define xST_DY_QUICK    (-11)
  #define xST_DY_NORMAL   (-12)
  #define xST_DY_AT_BEST  (-13)
</code></pre>
<p>[...]</p>
<pre><code class="language-cpp">long        StopTime;              //Calendar stop time of entry
</code></pre>
<p>Leider weiß ich jetzt nicht wie ich den long Datentyp zu ein Vernünftiges Datum und Uhrzeit bekomme (z.B. 2010-09-16 09:30:00).</p>
<p>Hoffe jemand kann mir helfen</p>
<p>MFG Eles</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/274166/timestamp-in-long-auslesen-bzw-bearbeiten</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 18:11:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/274166.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Sep 2010 07:57:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 07:57:02 GMT]]></title><description><![CDATA[<p>Hallo liebe C++ler,</p>
<p>Ich arbeite gerade an einen Projekt wo ich die Kalenderdaten eines Programms (David.fx) auf einer Internetseite Veröffentlichen will. Klappt auch ganz gut bis jetzt, das ein zigste was mir jetzt noch fehlt ist die Zeit/Datum anzeige.</p>
<p>Ich bekomme aus einer Datei (archive.dat) die Daten über einen von Hersteller vorgegeben struct ausgelesen. In diesen struct ist die Anfangs und die Endzeit des Termins in long gespeichert (z.B. StatusTime: 1285062033, SendTime: 1285236000, StopTime: 1285246800).<br />
hier ein Ausschnitt des structs:</p>
<pre><code class="language-cpp">long     StatusTime;           //Time of the log according to
                                 //the status, and the time is
                                 //coded as UCT (Unsiversal
                                 //Coordinated Time). Represents
                                 //a counter of secondes since
                                 //00:00:00 1.Jan.1970
  long     SendTime;             //Sending date for the job.
								 //Definitions are in the following
								 //table:
  #define ST_IMMEDIATE    -1
  #define ST_NIGHT        -2
  #define xST_DY          (-10)
  #define xST_DY_IMMEDIATE (-10)
  #define xST_DY_QUICK    (-11)
  #define xST_DY_NORMAL   (-12)
  #define xST_DY_AT_BEST  (-13)
</code></pre>
<p>[...]</p>
<pre><code class="language-cpp">long        StopTime;              //Calendar stop time of entry
</code></pre>
<p>Leider weiß ich jetzt nicht wie ich den long Datentyp zu ein Vernünftiges Datum und Uhrzeit bekomme (z.B. 2010-09-16 09:30:00).</p>
<p>Hoffe jemand kann mir helfen</p>
<p>MFG Eles</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1955148</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955148</guid><dc:creator><![CDATA[Eles]]></dc:creator><pubDate>Tue, 21 Sep 2010 07:57:02 GMT</pubDate></item><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 08:04:38 GMT]]></title><description><![CDATA[<p>lmgtfy: c++ time</p>
<p><a href="http://www.cplusplus.com/reference/clibrary/ctime/" rel="nofollow">http://www.cplusplus.com/reference/clibrary/ctime/</a></p>
<p><a href="http://www.cplusplus.com/reference/clibrary/ctime/mktime/" rel="nofollow">http://www.cplusplus.com/reference/clibrary/ctime/mktime/</a></p>
<p><a href="http://www.cplusplus.com/time_t" rel="nofollow">http://www.cplusplus.com/time_t</a></p>
<p><a href="http://www.cplusplus.com/reference/clibrary/ctime/time_t/" rel="nofollow">http://www.cplusplus.com/reference/clibrary/ctime/time_t/</a> schrieb:</p>
<blockquote>
<p>time_t</p>
<p>type<br />
&lt;ctime&gt;</p>
<p>Time type<br />
Type capable of representing times and support arithmetical operations.</p>
<p>This type is returned by the time function and is used as parameter by some other functions of the &lt;ctime&gt; header.</p>
<p>It is almost universally expected to be an <strong>integral value representing the number of seconds elapsed since 00:00 hours, Jan 1, 1970 UTC</strong>. This is due to historical reasons, since it corresponds to a unix timestamp, but is widely implemented in C libraries across all platforms.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1955151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955151</guid><dc:creator><![CDATA[padreigh]]></dc:creator><pubDate>Tue, 21 Sep 2010 08:04:38 GMT</pubDate></item><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 08:04:07 GMT]]></title><description><![CDATA[<pre><code>//............... Represents
                                 //a counter of secondes since
                                 //00:00:00 1.Jan.1970
</code></pre>
<p><a href="http://en.wikipedia.org/wiki/Unix_time" rel="nofollow">http://en.wikipedia.org/wiki/Unix_time</a><br />
<a href="http://linux.die.net/man/3/ctime" rel="nofollow">http://linux.die.net/man/3/ctime</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1955153</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955153</guid><dc:creator><![CDATA[Blue-Tiger]]></dc:creator><pubDate>Tue, 21 Sep 2010 08:04:07 GMT</pubDate></item><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 08:31:06 GMT]]></title><description><![CDATA[<p>Vielen dank für die Links, habe es endlich hin bekommen! Ist eigentlich recht simple wenn man weiß wie <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Hier mal meine Lösung (vielleicht verbesserungswürdig aber funktioniert^^)</p>
<pre><code class="language-cpp">time_t     now;
  struct tm  *ts;
  char       buf[80];

  now = TSR.SendTime;
  ts = localtime(&amp;now);
  strftime(buf, sizeof(buf), &quot;%Y-%m-%d %H:%M:%S %Z&quot;, ts);
  Memo1-&gt;Lines-&gt;Add(&quot;SendTime: &quot;+String(buf));
  now = TSR.StopTime;
  ts = localtime(&amp;now);
  strftime(buf, sizeof(buf), &quot;%Y-%m-%d %H:%M:%S %Z&quot;, ts);
  Memo1-&gt;Lines-&gt;Add(&quot;StopTime: &quot;+String(buf));
</code></pre>
<p>Wenn jemand eine besser oder kürzere Version hat, immer her damit^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1955178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955178</guid><dc:creator><![CDATA[Eles]]></dc:creator><pubDate>Tue, 21 Sep 2010 08:31:06 GMT</pubDate></item><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 09:49:38 GMT]]></title><description><![CDATA[<p>Da du ein Memo verwendest gehe ich davon aus, dass du irgendeinen Borland Compiler einsetzt. Die VCL hat einige Funktionen, die den Umgang mit Zeitstempel erleichtern.</p>
<pre><code class="language-cpp">AnsiString StartTime = UnixToDateTime( TSR.SendTime ).DateTimeString();
</code></pre>
<p>Statt DateTimeString() kann Format() benutzt werden, das den Zeitstempel entsprechend eines Formatstrings formatiert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1955239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955239</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Tue, 21 Sep 2010 09:49:38 GMT</pubDate></item><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 11:15:49 GMT]]></title><description><![CDATA[<p>Leider gibt es die Funktion UnixToDateTime() nicht, oder muss ich dazu eine besondere Bibliothek includen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1955304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955304</guid><dc:creator><![CDATA[Eles]]></dc:creator><pubDate>Tue, 21 Sep 2010 11:15:49 GMT</pubDate></item><item><title><![CDATA[Reply to TimeStamp in long auslesen bzw. bearbeiten on Tue, 21 Sep 2010 12:27:30 GMT]]></title><description><![CDATA[<p>Doch die gibts, taucht sogar in der Hilfe auf. Du musst dazu &lt;DateUtils.hpp&gt; inkludieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1955351</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1955351</guid><dc:creator><![CDATA[DocShoe]]></dc:creator><pubDate>Tue, 21 Sep 2010 12:27:30 GMT</pubDate></item></channel></rss>