def update_ecco_dataset_temporal_coverage_metadata(ecco_dataset):
    """

    Adds high-level temporal coverage metadata to dataset object if the 
    dataset object has 'time_bnds' coordinates
    
    Input
    ----------    
    ecco_dataset : an xarray dataset


    Output: 
    ----------    
    ecco_dataset : dataset updated with 'time_coverage_start/end', if such
    bounds can be determined
    
    """
    if 'time_bnds' in ecco_dataset.coords.keys():
        if len(ecco_dataset.time_bnds.shape) == 1:
            ecco_dataset.attrs['time_coverage_start'] = str(ecco_dataset.
                time_bnds.values[0])[0:19]
            ecco_dataset.attrs['time_coverage_end'] = str(ecco_dataset.
                time_bnds.values[1])[0:19]
        else:
            ecco_dataset.attrs['time_coverage_start'] = str(ecco_dataset.
                time_bnds.values[0][0])[0:19]
            ecco_dataset.attrs['time_coverage_end'] = str(ecco_dataset.
                time_bnds.values[-1][-1])[0:19]
    return ecco_dataset
