title: can boost gregorian date and boost posix time properly calculate unixtime?
body: <p>I am trying to write a simple timestamping system that provides epoch seconds and fractional seconds from the current time.  I am using boost library and have something like this:</p>
  
  <pre><code>const boost::posix_time::ptime epoch(boost::gregorian::date(1970, 1, 1));
  boost::posix_time::ptime time() {
      boost::posix_time::ptime now = boost::posix_time::microsec_clock::universal_time();
      return now;
  }
  boost::posix_time::time_duration dur = (time() - epoch);
  </code></pre>
  
  <p>and then use the following elements to extract the epoch values:</p>
  
  <pre><code>dur.total_seconds();
  dur.fractional_seconds();
  </code></pre>
  
  <p>Specifically, will this return a proper unix time?  If not, any suggestions as to how to correct it?  Thanks.</p>