title: boost ptime is thread safe or not?
body: <p>I try to find a thread-safe way to get local time. From boost example, I got this:</p>
  
  <pre><code>#include "boost/date_time/posix_time/posix_time.hpp"
    #include &lt;iostream&gt;
  
    int
    main() 
    {
      using namespace boost::posix_time;
      using namespace boost::gregorian;
  
      //get the current time from the clock -- one second resolution
      ptime now = second_clock::local_time();
      //Get the date part out of the time
      date today = now.date();
      date tommorrow = today + days(1);
      ptime tommorrow_start(tommorrow); //midnight 
  
      //iterator adds by one hour
      time_iterator titr(now,hours(1)); 
      for (; titr &lt; tommorrow_start; ++titr) {
        std::cout &lt;&lt; to_simple_string(*titr) &lt;&lt; std::endl;
      }
  
      time_duration remaining = tommorrow_start - now;
      std::cout &lt;&lt; "Time left till midnight: " 
                &lt;&lt; to_simple_string(remaining) &lt;&lt; std::endl;
      return 0;
    }
  </code></pre>
  
  <p>But I didn't know if it can be used in multi-threading environment?  </p>