from typing import Optional
from datetime import datetime


def str2datetime(s: str) -> Optional[datetime]:
    """
    Converts the string into a datetime format, if unparsable, returns None
    Args:
        s: The date string

    Returns:
        The datetime object, if unparsable, returns None
    """
    try:
        return datetime.strptime(s, '%Y-%m-%d %H:%M:%S')
    except ValueError:
        return None