Thông báo: Tất cả dự án phi thương mại đã đăng ký sử dụng Earth Engine trước ngày 15 tháng 4 năm 2025 phải xác minh điều kiện sử dụng phi thương mại để duy trì quyền truy cập vào Earth Engine.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trả về một DateRange bao gồm đơn vị thuộc loại đã chỉ định chứa ngày này, ví dụ: Date('2013-3-15').getRange('year') trả về DateRange('2013-1-1', '2014-1-1').
Cách sử dụng
Giá trị trả về
Date.getRange(unit, timeZone)
DateRange
Đối số
Loại
Thông tin chi tiết
this: date
Ngày
unit
Chuỗi
Một trong các giá trị "năm", "tháng", "tuần", "ngày", "giờ", "phút" hoặc "giây".
timeZone
Chuỗi, mặc định: rỗng
Múi giờ (ví dụ: 'America/Los_Angeles'); mặc định là UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-06-24 UTC."],[[["`Date.getRange()` returns a `DateRange` object representing the specified time unit (year, month, week, day, hour, minute, or second) that contains the input date."],["The returned `DateRange` spans the entire unit of time, for example, if the input date is March 15, 2013, and the unit is 'year', the returned `DateRange` will be from January 1, 2013, to January 1, 2014."],["You can optionally specify a time zone for the `DateRange`; if not provided, it defaults to UTC."],["This function is useful for creating time-based filters or selecting data within specific time intervals."]]],[]]