def extract_start_end(df):
    """
    format start and end time

    Parameters
    ----------
    df : pd.DataFrame
        data with setting time as index

        time format:
            '%Y-%m-%d %H:%M' or
            '%Y-%m-%d'

    Returns
    -------
    start, end : str
        datetime string, format:
        '%Y-%m-%d %H:%M'
    """
    fmt_time = '%Y-%m-%d-%H-%M'
    start = df.index[0].strftime(fmt_time)
    end = df.index[-1].strftime(fmt_time)
    return start, end