title: Is there a builtin alternative to std::put_time for GCC <5?
body: <p>I'm stuck on GCC4.8 for the time being. I want to print out the current time as something other than seconds. If <code>put_time</code> worked, my code would be something simple, like this:</p>
  
  <pre><code>std::cout &lt;&lt; std::setw(24) &lt;&lt; std::put_time(c_time, "[%T%z %F] ");
  </code></pre>
  
  <p>Without <code>put_time</code>, I'd have to access the elements of <code>c_time</code> manually and do all the formatting manually, which would be a pain in the a** and is something I'm much rather avoid if possible. Note that this <strong><em>does not</em></strong> mean that I never want to interact with C in any way, even indirectly -- I'd just like to avoid coding in C directly if possible.</p>
  
  <p>However, I can't find any alternatives to <code>std::put_time</code>, aside from <code>strftime</code>, which I'd like to avoid because it requires almost double the lines of code and is a lot harder to read, at least for me. Also, this is C++, not C, so I'd like to steer clear of C functions whenever possible.</p>
  
  <p>Am I missing something? Is there a builtin alternative to <code>std::put_time</code> which works under GCC 4.8?</p>
  
  <p>Note that it doesn't have to work in exactly the same way -- if it, say, printed it directly to the output, rather than being a stream manipulator, that would be perfectly fine too, as would a function which returned a <code>std::string</code> containing the formatted time.</p>
  
  <p>I've done a good bit of Googling and found <a href="http://www.cplusplus.com/reference/chrono/" rel="noreferrer"><code>&lt;chrono&gt;</code></a>, but that doesn't work because it doesn't have anything to format the time automatically. I'd still have to do it manually, and I'm pretty sure it would be <em>more</em> work, since I'd have to parse the number of seconds since the epoch into a year, month, day, etc.</p>