Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting Seconds to a DATE

Status
Not open for further replies.

AnnaHere

IS-IT--Management
May 16, 2000
17
0
0
AU
Hi guys,<br>I have used the stat() function for &quot;file.txt&quot; to get one of its variables (st_mtime) - showing when file was last modified in seconds since Jan 1, 1970 00:00:00UTC<br><br>Because it is in seconds I cannot see what the Day,Month,Year...etc.<br>Is their a function that converts (seconds) to (DATE)<br><br>thanks,<br>Anna<br><br>#include &lt;stdio.h&gt;<br>#include &lt;time.h&gt;<br><br>void main()<br>{<br>struct stat s;<br><br>stat(&quot;file.txt&quot;,&s);<br>printf(&quot;\nTime last modified: %d&quot;,s.st_mtime);<br>}<br>
 
Hi Guys,<br>Worked it out, feel terrible cause was so simple<br>Seeya<br>Anna
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top