title: Why are my two date fields not identical when I copy them?
body: <p>I use django, and have two models with a models.DateTimeField(). Sometimes I need a copy of a date - but look at this: </p>
  
  <pre><code>&gt;&gt;&gt;myobject.date = datetime.datetime.now()
  &gt;&gt;&gt;print myobject.date
  &gt;&gt;&gt;2010-04-27 12:10:43.526277
  
  &gt;&gt;&gt;other_object.date_copy = myobject.date
  &gt;&gt;&gt;print other_object.date_copy
  &gt;&gt;&gt;2010-04-27 12:10:43
  </code></pre>
  
  <p>Why are these two dates not identical, and how do I make an excact copy of myobject.date?</p>
  
  <p>Edit:</p>
  
  <p>I made the mistake of oversimplifying the code I used. The following code will replicate the weirdness:</p>
  
  <pre><code>&gt;&gt;&gt;myobject.date = datetime.datetime.now()
  &gt;&gt;&gt;print myobject.date
  &gt;&gt;&gt;2010-04-27 12:10:43.526277
  &gt;&gt;&gt;myobject.save()
  &gt;&gt;&gt;myobject_retrieved_from_db = Myobject.objects.get(id=myobject.id) 
  
  &gt;&gt;&gt;other_object.date_copy = myobject_retrieved_from_db.date
  &gt;&gt;&gt;print other_object.date_copy
  &gt;&gt;&gt;2010-04-27 12:10:43
  </code></pre>
  
  <p>As Petriborg suggested, the difference in time is caused by storing to the database:</p>
  
  <pre><code>&gt;&gt;&gt;print myobject_retrieved_from_db.date
  &gt;&gt;&gt;2010-04-27 12:10:43
  </code></pre>
  
  <p>Mystery solved.</p>