from datetime import datetime


def _append_current_datetime(file_path: str):
    """
    Insert date and time into file path and return it.
    """
    now = datetime.now().strftime("%Y_%m_%d_%H%M%S")
    if file_path.endswith('.log'):
        return file_path.replace(file_path, f'_{now}.log')
    return f'{file_path}_{now}.log'