def dt2str_iso(dt, show_ms=False):
    """Formats datetime to the iso format

    Args:
        dt(str): datetime object
        show_ms(bool): supress milisseconds

    Returns:
        str: time in iso format
    """

    if show_ms:
        return dt.strftime("%Y-%m-%d %H:%M:%S.%f")
    else:
        return dt.strftime("%Y-%m-%d %H:%M:%S")