<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def date_to_datetime(x):
 """Convert a date into a datetime"""

    if not isinstance(x, datetime) and isinstance(x, date):
        return datetime.combine(x, time())
    return x