from datetime import datetime


def timestamp(time_only=False):
    """
    Get the current time.
    :param time_only: bool; exclude year, month, and date or not
    :return: str; the current time
    """

    if time_only:
        formatter = '%H:%M:%S'
    else:
        formatter = '%Y-%m-%d %H:%M:%S'
    return datetime.now().strftime(formatter)