title: Convert time_t To Integer
body: <p>How should I modify this code to print("Its Midnight") every 00:00AM ?</p>
  
  <pre><code>#include &lt;time.h&gt;
  #include &lt;stdio.h&gt;
  
  int main(void)
  {
    struct tm * localtime ( const time_t * ptr_time );
    struct tm 
   {
    int tm_sec;         /* segundos,  range 0 to 59          */
    int tm_min;         /* minutos, range 0 to 59           */
    int tm_hour;        /* horas, range 0 to 23             */
    int tm_mday;        /* dia do mes, range 1 to 31  */
    int tm_mon;         /* mes, range 0 to 11             */
    int tm_year;        /* numero de anos desde 1900   */
    int tm_wday;        /* dia da semana, range 0 to 6    */
    int tm_yday;        /* dia no ano, range 0 to 365  */
    int tm_isdst;       
    };
      time_t mytime;
      mytime = time(NULL);
      printf(ctime(&amp;mytime));
  /*
   if(str_time.tm_hour == 00 &amp;&amp; str_time.tm_min == 00 &amp;&amp; str_time.tm_sec == 00 )
  {
  printf("Its midnight");
  }
  */
    return 0;
  }
  </code></pre>
  
  <p>The Output of time_t is:
  Www Mmm dd hh:mm:ss yyyy</p>
  
  <p>Example:
  Tue Feb 26 09:01:47 2009</p>