import math


def fcst_hr_min(time,start):
    """!Return forecast time in hours and minutes.

    Given a forecast datetime.datetime and an analysis
    datetime.datetime, this returns a tuple containing the forecast
    hour and minute, rounded to the nearest integer minute.
    @param time forecast time as a datetime.datetime
    @param start analysis time as a datetime.datetime
    @returns a tuple (ihours,iminutes)"""
    dt=time - start # forecast time
        # Convert to hours and minutes, round to nearest minute:
    fhours=dt.days*24 + dt.seconds/3600 + dt.microseconds/3600e6
    (fpart,ihours)=math.modf(fhours)
    if fpart>1.:
        assert(fpart<1.)
    iminutes=round(fpart*60)
    return (ihours,iminutes)