title: How do you print a C++11 time_point?
body: <p>I've created a time point, but I have been struggling to print it to the terminal.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;chrono&gt;
  
  int main(){
  
      //set time_point to current time
      std::chrono::time_point&lt;std::chrono::system_clock,std::chrono::nanoseconds&gt; time_point;
      time_point = std::chrono::system_clock::now();
  
      //print the time
      //...
  
      return 0;
  }
  </code></pre>
  
  <p>The only documentation I can find that prints a time_point is found here:
  <a href="http://en.cppreference.com/w/cpp/chrono/time_point">http://en.cppreference.com/w/cpp/chrono/time_point</a></p>
  
  <p>however, I'm not even able to create a time_t based on my time_point(like the example).</p>
  
  <pre><code>std::time_t now_c = std::chrono::system_clock::to_time_t(time_point); //does not compile
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono: In instantiation of ‘constexpr std::chrono::time_point&lt;_Clock, _Dur&gt;::time_point(const std::chrono::time_point&lt;_Clock, _Dur2&gt;&amp;) [with _Dur2 = std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000000l&gt; &gt;; _Clock = std::chrono::system_clock; _Dur = std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000l&gt; &gt;]’:
  time.cpp:13:69:   required from here
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:540:32: error: no matching function for call to ‘std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000l&gt; &gt;::duration(std::chrono::time_point&lt;std::chrono::system_clock, std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000000l&gt; &gt; &gt;::duration)’
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:540:32: note: candidates are:
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:247:14: note: template&lt;class _Rep2, class _Period2, class&gt; constexpr std::chrono::duration::duration(const std::chrono::duration&lt;_Rep2, _Period2&gt;&amp;)
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:247:14: note:   template argument deduction/substitution failed:
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:243:46: error: no type named ‘type’ in ‘struct std::enable_if&lt;false, void&gt;’
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:240:23: note: template&lt;class _Rep2, class&gt; constexpr std::chrono::duration::duration(const _Rep2&amp;)
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:240:23: note:   template argument deduction/substitution failed:
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:236:27: error: no type named ‘type’ in ‘struct std::enable_if&lt;false, void&gt;’
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:234:12: note: constexpr std::chrono::duration&lt;_Rep, _Period&gt;::duration(const std::chrono::duration&lt;_Rep, _Period&gt;&amp;) [with _Rep = long int; _Period = std::ratio&lt;1l, 1000000l&gt;]
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:234:12: note:   no known conversion for argument 1 from ‘std::chrono::time_point&lt;std::chrono::system_clock, std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000000l&gt; &gt; &gt;::duration {aka std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000000l&gt; &gt;}’ to ‘const std::chrono::duration&lt;long int, std::ratio&lt;1l, 1000000l&gt; &gt;&amp;’
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:232:12: note: constexpr std::chrono::duration&lt;_Rep, _Period&gt;::duration() [with _Rep = long int; _Period = std::ratio&lt;1l, 1000000l&gt;]
  /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../include/c++/4.7.2/chrono:232:12: note:   candidate expects 0 arguments, 1 provided
  </code></pre>