Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить некоммерческое право на сохранение доступа к Earth Engine.
ee.Date.get
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Возвращает указанную единицу измерения этой даты.
Использование | Возврат | Date. get (unit, timeZone ) | Длинный |
Аргумент | Тип | Подробности | это: date | Дата | |
unit | Нить | Одно из значений: «год», «месяц» (возвращает 1-12), «неделя» (1-53), «день» (1-31), «час» (0-23), «минута» (0-59) или «секунда» (0-59). |
timeZone | Строка, по умолчанию: null | Часовой пояс (например, «Америка/Лос-Анджелес»); по умолчанию — UTC. |
Примеры
Редактор кода (JavaScript)
var date = ee.Date('2021-4-30T07:15:31');
print('Year', date.get('year'));
print('Month', date.get('month'));
print('Week', date.get('week'));
print('Day', date.get('day'));
print('Hour', date.get('hour'));
print('Minute', date.get('minute'));
print('Second', date.get('second'));
Настройка Python
Информацию об API Python и использовании geemap
для интерактивной разработки см. на странице «Среда Python» .
import ee
import geemap.core as geemap
Colab (Python)
date = ee.Date('2021-4-30T07:15:31')
display('Year:', date.get('year'))
display('Month:', date.get('month'))
display('Week:', date.get('week'))
display('Day:', date.get('day'))
display('Hour:', date.get('hour'))
display('Minute:', date.get('minute'))
display('Second:', date.get('second'))
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eDate.get()\u003c/code\u003e function retrieves a specific component (year, month, week, day, hour, minute, or second) of a given date object.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a \u003ccode\u003eunit\u003c/code\u003e argument specifying the desired component and an optional \u003ccode\u003etimeZone\u003c/code\u003e argument for specifying the time zone (defaults to UTC).\u003c/p\u003e\n"],["\u003cp\u003eThe function returns the requested component as a long integer.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDate.get()\u003c/code\u003e can be used within both JavaScript and Python Earth Engine environments.\u003c/p\u003e\n"]]],[],null,["# ee.Date.get\n\nReturns the specified unit of this date.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------|---------|\n| Date.get`(unit, `*timeZone*`)` | Long |\n\n| Argument | Type | Details |\n|--------------|-----------------------|-------------------------------------------------------------------------------------------------------------------------|\n| this: `date` | Date | |\n| `unit` | String | One of 'year', 'month' (returns 1-12), 'week' (1-53), 'day' (1-31), 'hour' (0-23), 'minute' (0-59), or 'second' (0-59). |\n| `timeZone` | String, default: null | The time zone (e.g., 'America/Los_Angeles'); defaults to UTC. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nvar date = ee.Date('2021-4-30T07:15:31');\n\nprint('Year', date.get('year'));\nprint('Month', date.get('month'));\nprint('Week', date.get('week'));\nprint('Day', date.get('day'));\nprint('Hour', date.get('hour'));\nprint('Minute', date.get('minute'));\nprint('Second', date.get('second'));\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\ndate = ee.Date('2021-4-30T07:15:31')\n\ndisplay('Year:', date.get('year'))\ndisplay('Month:', date.get('month'))\ndisplay('Week:', date.get('week'))\ndisplay('Day:', date.get('day'))\ndisplay('Hour:', date.get('hour'))\ndisplay('Minute:', date.get('minute'))\ndisplay('Second:', date.get('second'))\n```"]]