from datetime import datetime
import time


def transform_date_to_nanoseconds(date) -> int:
    """Get date from string and return it in UNIX nanoseconds format.

    Args:
        date: (str) Datetime string in `%Y-%m-%d %H:%M:%S` format.

    Returns:
        int: Date in UNIX nanoseconds.
    """
    date = datetime.strptime(date, '%Y-%m-%d %H:%M:%S').timetuple()  # noqa: WPS323
    date = time.mktime(date) * 10 ** 9

    return int(date)