'Ensure the request has been received in a timely manner.'

def validate_timestamp(self, value):

    date_time = from_timestamp(value)
    if (not date_time):
        msg = u'[{}]    is    not    a    valid    timestamp'.format(value)
        log.warning(msg)
        raise serializers.ValidationError(msg)
    elapsed = (datetime.datetime.now(pytz.UTC) - date_time).total_seconds()
    if (elapsed > settings.CREDIT_PROVIDER_TIMESTAMP_EXPIRATION):
        msg = u'[{value}]    is    too    far    in    the    past    (over    [{elapsed}]    seconds).'.format(value=value, elapsed=elapsed)
        log.warning(msg)
        raise serializers.ValidationError(msg)
    return value
