Converting seconds after epoch into unix time
<p>I have seconds (say x, x is long long data type) after epoch. I wish to convert it into unix time using <code>&lt;ctime&gt;</code> library. The issue is, I want a time_t variable for <code>gmtime()</code> to work, I am unable to make my <code>x</code> (<code>long long</code>) converted to <code>time_t</code>.</p>

<p>This is what am doing:</p>

<pre><code>//x is number of seconds after epoch, I want that in unix time 
time_t t=x; 
printf("%s\n",asctime(gmtime(&amp;t)));
</code></pre>

<p>Can I somehow typecast <code>x</code> into <code>time_t</code>?</p>
