human
Can you show me a Python function to generate random datetime in Python.
assistant
Here is a Python function to generate random datetime in Python

import datetime

def _random_datetime():
    """Generate a random datetime."""
    return datetime.datetime.now()

# Enter the datetime
datetime_now = datetime.datetime.now()

# Calling the function
datetime_now = _random_datetime()

#Remember to inspect code for bugs.