from datetime import datetime


def time(keep_ms=False):
    """Returns current time.

    Parameters
    ----------
    keep_ms : bool, optional
        If True, includes milliseconds.
    Returns
    -------
    str
        Current time.
    """
    time_str = str(datetime.now())
    if keep_ms is False:
        time_str = time_str.split('.')[0]
    return time_str