ee.Date.advance

Crie uma nova data adicionando as unidades especificadas à data fornecida.

UsoRetorna
Date.advance(delta, unit, timeZone)Data
ArgumentoTipoDetalhes
dateData
deltaPonto flutuante
unitStringPode ser "ano", "mês", "semana", "dia", "hora", "minuto" ou "segundo".
timeZoneString, padrão: nullO fuso horário (por exemplo, 'America/Los_Angeles'); padrão é UTC.

Exemplos

Editor de código (JavaScript)

// Defines a base date/time for the following examples.
var BASE_DATE = ee.Date('2020-7-1T13:00', 'UTC');
print(BASE_DATE, 'The base date/time');

// Demonstrates basic usage.
print(BASE_DATE.advance(1, 'week'), '+1 week');
print(BASE_DATE.advance(2, 'years'), '+2 years');

// Demonstrates that negative delta moves back in time.
print(BASE_DATE.advance(-1, 'second'), '-1 second');

Configuração do Python

Consulte a página Ambiente Python para informações sobre a API Python e o uso de geemap para desenvolvimento interativo.

import ee
import geemap.core as geemap

Colab (Python)

# Defines a base date/time for the following examples.
BASE_DATE = ee.Date('2020-01-01T00:00', 'UTC')
display('The base date/time', BASE_DATE)

# Demonstrates basic usage.
display('+1 week', BASE_DATE.advance(1, 'week'))
display('+2 years', BASE_DATE.advance(2, 'years'))

# Demonstrates that negative delta moves back in time.
display('-1 second', BASE_DATE.advance(-1, 'second'))