title: Negative value returned by time
body: <p>I try to return number of second from 1970 with time function with <code>stm32f4</code> card.</p>
  
  <p>I have these datatype configured</p>
  
  <pre><code>RTC_HandleTypeDef RtcHandle;
  RTC_DateTypeDef dateStruct;
  RTC_TimeTypeDef timeStruct;
  </code></pre>
  
  <p>I do a call to</p>
  
  <pre><code>HAL_RTC_GetTime
  HAL_RTC_GetDate
  </code></pre>
  
  <p>and i call this function</p>
  
  <pre><code>long SystemClock::getUnixTimestamp()
    struct tm timeinfo;
  
    //Setup a tm structure based on the RTC
    timeinfo.tm_wday = dateStruct.WeekDay;
    timeinfo.tm_mon = dateStruct.Month - 1;
    timeinfo.tm_mday = dateStruct.Date;
    timeinfo.tm_year = dateStruct.Year + 100;
    timeinfo.tm_hour = timeStruct.Hours;
    timeinfo.tm_min = timeStruct.Minutes;
    timeinfo.tm_sec = timeStruct.Seconds;
  
    time_t rawtime = mktime(&amp;timeinfo);
  
    trace_printf("Current date and time are: %s\n", ctime(&amp;rawtime));
    long x = time(&amp;rawtime);
    trace_printf("time %lu\n", x);
    return x;
  }
  </code></pre>
  
  <p>I see</p>
  
  <pre><code>Current date and time are: Wed Apr 29 22:46:00 2015
  time 1430347560
  
  5 second later, i do another call to HAL_RTC_GetTime, HAL_RTC_GetDate, getUnixTimestamp and i get
  
  Current date and time are: Wed Apr 29 22:46:05 2015
  time 1430347560
  </code></pre>
  
  <p>why time is not modified?</p>