title: ctime() method how to print the hours and seconds?
body: <p>HI,</p>
  
  <p>I have the following code:</p>
  
  <pre><code>int main ()
  {
    time_t rawtime;
  
    time ( &amp;rawtime );
    printf ( "The current local time is: %s", ctime (&amp;rawtime) );
  
    std::string datetoString(ctime (&amp;rawtime) );
    return 0;
  }
  
  std::string datetoString (char dat[]) 
                       //how to add ctime(&amp;rawtime) in char dat[]?
  {
      std::string rez;
      struct tm;
      strptime(dat, "%d %b %Y %H:%M:%S", &amp;tm);
          // what library do i have to inclide for strptime?
  
      rez=tm.tm_mday + "-" + tm.tm_mon +"-"+ tm.tm_year+ hour+min+sec;
                                  //how to print the hour,minutes and secods?
  
  return rez;
  }
  </code></pre>
  
  <p>i have errors in the places where i've commented my questions.</p>