title: Python/Django - datetime dropping the time portion when updating serializer data
body: <p>I am using Django REST Framework, specifically a <code>ModelSerializer</code> instance, to receive some date/time information, among other fields.  The Django form which POSTs or PUTs to my view is using a single field for date, and separate fields for hour, minute, and am/pm.</p>
  
  <p>I wrote a function to deal with recombining the values into a Python datetime object, but for some reason, when my function returns a correct datetime, the time portion is getting zero'ed out when the datetime is assigned back to the serializer object for saving.  </p>
  
  <p>I am new to DRF so maybe I just need to approach this another way altogether....</p>
  
  <pre><code>def roomeventrequest(request, roomevent_id):
      """
      THIS IS THE VIEW
      """
  
  ...
  
      elif request.method == 'PUT':
          data = JSONParser().parse(request)
          roomevent = RoomEvent.objects.get(pk=roomevent_id)
          serializer = RoomEventSerializer(roomevent, data=data)
          if serializer.is_valid():
              serializer.data['start_datetime'] = _process_datetime(serializer.validated_data['start_datetime'], 
                                                                    data['start_hour'], 
                                                                    data['start_min'], 
                                                                    data['start_ampm'])
              serializer.data['end_datetime'] = _process_datetime(serializer.validated_data['start_datetime'], 
                                                                  data['end_hour'], 
                                                                  data['end_min'], 
                                                                  data['start_ampm'])
              print (serializer.data['start_datetime'])
              print (serializer.data['end_datetime'])
              serializer.save()
              return JSONResponse(serializer.data, status=201)
          return JSONResponse(serializer.errors, status=400)  
  
  
  
  def _process_datetime(date_obj, hour, minute, ampm):
      print (date_obj)
      if ampm == 'am' and hour == 12:
          hour = 0
      elif ampm == 'pm':
          hour += 12
      return_date = date_obj.replace(minute=int(minute), hour=int(hour))
      print(return_date)
      return return_date
  </code></pre>
  
  <p>And the above outputs the following from the <code>print</code> statements:</p>
  
  <pre><code>2015-05-21 00:00:00
  2015-05-21 08:00:00
  2015-05-21 00:00:00
  2015-05-21 09:00:00
  2015-05-21T00:00:00
  2015-05-21T00:00:00
  </code></pre>
  
  <p>Why is the resulting time portion blank?  Where have I gotten off track here?</p>