title: How to get local time c++
body: <p>I need to get the current time (hour,minutes and seconds) and add 30 minutes. In final i need to save the result to an integer variable.</p>
  
  <p>How it's possible to do?</p>
  
  <p>My code at the moment:</p>
  
  <pre><code>int main()
  {
  
    time_t currentTime;
    struct tm *localTime;
  
    time( &amp;currentTime );
    localTime = localtime( &amp;currentTime );
  
    int Hour   = localTime-&gt;tm_hour;
    int Min    = localTime-&gt;tm_min;
    int Sec    = localTime-&gt;tm_sec;
  
    std::cout &lt;&lt; "Execute at: " &lt;&lt; Hour &lt;&lt; ":" &lt;&lt; Min &lt;&lt; ":" &lt;&lt; Sec &lt;&lt; std::endl;
  
    return 0;
  
  }
  </code></pre>
  
  <p>Thanks</p>