title: Django rest framework updating time using EPOCH time
body: <p>I need to take a form that has a field "starttime" that is in EPOCH and convert it to </p>
  
  <ol>
  <li>python datetime</li>
  <li>fieldname = "created"</li>
  </ol>
  
  <p>when I have:</p>
  
  <h1>models.py</h1>
  
  <pre><code>class Snippet(models.Model):
      created = models.DateTimeField(auto_now_add=True
  
      class Meta:
          ordering = ('created',)
  </code></pre>
  
  <h1>serializers.py</h1>
  
  <pre><code>import time
  class SnippetSerializer(serializers.ModelSerializer):
      starttime  = serializers.SerializerMethodField('epoch')
  
      def epoch(self, obj):
          """ Return epoch time for a datetime object or ``None``"""
          try:
              return int(time.mktime(obj.created.timetuple()))
          except (AttributeError, TypeError):
              return None
  
      class Meta:
          model = Snippet
          fields = ('starttime')
  </code></pre>
  
  <p>If I:</p>
  
  <p>"GET" /snippets/1/</p>
  
  <blockquote>
    <blockquote>
      <p>{"id":1, 'starttime':13232111}</p>
    </blockquote>
  </blockquote>
  
  <p>I want to be able to do:</p>
  
  <p>"POST" /snippets/1/ {"id":1, 'starttime':1}</p>
  
  <blockquote>
    <blockquote>
      <p>{"id":1, 'starttime':1}</p>
    </blockquote>
  </blockquote>
  
  <p>right now, it just ignores the request.  I am forced to use unix epoch times to conform to existing API's.</p>