title: Boost posix time
body: <p>I have a very strange problem now.</p>
  
  <pre><code>class Message
  {
    Field time;
    void SetTimeStamp()
    {
      time.dataTimeValue = &amp;boost::posix_time::microsec_clock::universal_time();
    }
    void SetOtherFields()
    {
    }
  };
  
  class Field
  {
    boost::posix::ptime* dateTimeValue;
  };
  
  int main()
  {
    Message myMessage;
    myMessage.SetTimeStamp();
    myMessage.SetOtherFields();
  }
  </code></pre>
  
  <p>When I call <code>myMessage.SetTimeStamp()</code>, I can set the TimeStamp correctly, I can see the address of <code>dateTimeValue</code> and the Value makes sense. But after that, I call <code>myMessage.SetOtherFields()</code>, the <code>dateTimeValue</code> pointer still points to the same memory which is good, but the value in that memory changes to a carzy number. I don't know what happened.</p>