title: Why gmtime() function returns NULL?
body: <p>I am trying to set RTC time on <code>STM32L051T6</code> microcontroller using <code>epoch</code> time. So following is my code.</p>
  
  <pre><code>void Rtc_SetTime(uint32_t time_)
  {
      struct tm* brokenTime;
      const time_t temp = 3600;
  
      brokenTime = gmtime(&amp;temp);
  
      if (NULL == brokenTime)
      {
         printf("Error: Failed to convert time.\r\n");
      }
  }
  </code></pre>
  
  <p>When I call above function. It always goes to <code>if</code> statement and prints Error. I have tried passing  values 3600, 1459841178 as arguments. All fails. What is wrong with the code?</p>