Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Возвращает разницу между двумя датами в указанных единицах измерения; результат представляет собой число с плавающей точкой и основан на средней длине единицы измерения.
Использование
Возвраты
Date.difference (start, unit)
Плавать
Аргумент
Тип
Подробности
это: date
Дата
start
Дата
unit
Нить
Один из вариантов: «год», «месяц», «неделя», «день», «час», «минута» или «секунда».
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-06-24 UTC."],[[["`Date.difference()` calculates the difference between two dates, returning a floating-point number."],["The difference is calculated based on the average length of the specified unit (e.g., 'year', 'month', 'week', 'day', 'hour', 'minute', or 'second')."],["The function takes two `ee.Date` objects as input, representing the start and end points for the calculation."],["The result is relative to the first date and can be positive or negative depending on the order of the dates."]]],["`Date.difference` calculates the difference between two dates, returning a floating-point number based on the average length of the specified unit. The function takes a `start` date and a `unit` string ('year', 'month', 'week', 'day', 'hour', 'minute', or 'second') as arguments. The output represents the difference in the chosen unit. Examples show calculating differences in days and weeks between two dates, showcasing both JavaScript and Python implementations.\n"]]