from datetime import datetime


def get_time_from_header(hdu):
    """ Make a datetime object from a fits header.
    Include fractional seconds in the returned value
    """
    tstring1 = hdu[0].header['DATE-OBS']
    t1 = datetime.strptime(tstring1, '%Y-%m-%dT%H:%M:%S.%f')
    return t1