def get_enrollment_dates(course):
    'Takes a course object and returns student dates of enrollment.\n    Useful for handling late registrations and modified deadlines.\n\n    Example:\n    course.get_enrollment_date()'
    url_path = posixpath.join('api', 'v1', 'courses', course['course_id'], 'enrollments')
    api_url = urllib.parse.urljoin(course['hostname'], url_path)
    token = course['token']
    resp = None
    students = []
    while ((resp is None) or (resp.links['current']['url'] != resp.links['last']['url'])):
        resp = requests.get(url=(api_url if (resp is None) else resp.links['next']['url']), headers={'Authorization': f'Bearer {token}', 'Accept': 'application/json+canvas-string-ids'}, json={'type': ['StudentEnrollment'], 'per_page': '100'})
        students.extend(resp.json())
    enrollment_dates = {}
    for st in students:
        enrollment_dates[str(st['user_id'])] = str(st['created_at']).strip('Z').replace('T', '-').replace(':', '-')[:16]
    return enrollment_dates
Takes a course object and returns student dates of enrollment.
Useful for handling late registrations and modified deadlines.

Example:
course.get_enrollment_date()
def get_enrollment_dates(course):
    'Takes a course object and returns student dates of enrollment.\n    Useful for handling late registrations and modified deadlines.\n\n    Example:\n    course.get_enrollment_date()'
    url_path = posixpath.join('api', 'v1', 'courses', course['course_id'], 'enrollments')
    api_url = urllib.parse.urljoin(course['hostname'], url_path)
    token = course['token']
    resp = None
    students = []
    while ((resp is None) or (resp.links['current']['url'] != resp.links['last']['url'])):
        resp = requests.get(url=(api_url if (resp is None) else resp.links['next']['url']), headers={'Authorization': f'Bearer {token}', 'Accept': 'application/json+canvas-string-ids'}, json={'type': ['StudentEnrollment'], 'per_page': '100'})
        students.extend(resp.json())
    enrollment_dates = {}
    for st in students:
        enrollment_dates[str(st['user_id'])] = str(st['created_at']).strip('Z').replace('T', '-').replace(':', '-')[:16]
    return enrollment_dates