title: converting milliseconds to date in C
body: <p>Is there any way of converting <code>milliseconds</code> to <code>date</code> in C? </p>
  
  <p>What I am trying to do is write a small application in C that can return the financial year and the like(quarter, week) given the start month and <code>isCurentYear</code> bool, where the input might be milliseconds or a date!</p>
  
  <p>In the first place, is there any way by which this can be achieved in C?</p>
  
  <p>And if so, in the process of finding out a way of converting <code>milliseconds</code> to <code>date</code>
  I have found out that the use of <code>time_t</code> takes the current millis of our system and by creating a structure pointing to it,it permits us to extract the year,month, date, sec etc!</p>
  
  <p>Refer the below code:</p>
  
  <pre><code>#include &lt;sys/time.h&gt;
  #include&lt;stdio.h&gt;
  #include&lt;time.h&gt;
  
  void main()
  {
      time_t t = time(000);
      //time_t t = time(0);
      struct tm tm = *localtime(&amp;t);
  
      printf("now: %d-%d-%d %d:%d:%d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
                                         tm.tm_hour, tm.tm_min, tm.tm_sec);
  }
  </code></pre>
  
  <p>And also, can <code>time_t</code> be used to store <code>millisecond</code> values so that it can be converted to date using tm struct?</p>