ประกาศ : โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์ทั้งหมดที่ลงทะเบียนเพื่อใช้ Earth Engine ก่อนวันที่
15 เมษายน 2025 ต้อง
ยืนยันการมีสิทธิ์ที่ไม่ใช่เชิงพาณิชย์ เพื่อรักษาสิทธิ์เข้าถึง หากคุณไม่ยืนยันภายในวันที่ 26 กันยายน 2025 ระบบอาจระงับสิทธิ์เข้าถึงของคุณ
ส่งความคิดเห็น
ee.Date
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
สร้างออบเจ็กต์ Date ใหม่
การใช้งาน การคืนสินค้า ee.Date(date, tz )
วันที่
อาร์กิวเมนต์ ประเภท รายละเอียด date
ComputedObject|Date|Number|String วันที่ที่จะแปลง ซึ่งอาจเป็นตัวเลข (จำนวนมิลลิวินาทีนับตั้งแต่ Epoch), สตริงวันที่ ISO, วันที่ JavaScript หรือ ComputedObject tz
สตริง ไม่บังคับ เขตเวลาที่ไม่บังคับซึ่งใช้ได้กับวันที่แบบสตริงเท่านั้น
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
// Numeric inputs are interpreted as milliseconds from Unix epoch.
print ( ee . Date ( 0 )); // Date (1970-01-01 00:00:00)
// Scale factors can make numerical inputs more readable (e.g. 60 seconds).
print ( ee . Date ( 60 * 1000 )); // Date (1970-01-01 00:01:00)
// ISO 8601 date string input examples.
print ( ee . Date ( '2020' )); // Date (2020-01-01 00:00:00)
print ( ee . Date ( '2017-6-24' )); // Date (2017-06-24 00:00:00)
print ( ee . Date ( '2017-06-24' )); // Date (2017-06-24 00:00:00)
print ( ee . Date ( '2017-6-24T00:14:46' )); // Date (2017-06-24 00:14:46)
print ( ee . Date ( '2017-06-24T23:59:59' )); // Date (2017-06-24 23:59:59)
// With an optional time zone.
print ( ee . Date ( '2020' , 'US/Mountain' )); // Date (2020-01-01T07:00:00)
// Convert JavaScript now to Earth Engine Date
print ( ee . Date ( Date . now ()));
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap
เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
from datetime import datetime
# Numeric inputs are interpreted as milliseconds from Unix epoch.
print ( ee . Date ( 0 ) . format () . getInfo ()) # 1970-01-01T00:00:00
# Scale factors can make numerical inputs more readable (e.g. 60 seconds).
print ( ee . Date ( 60 * 1000 ) . format () . getInfo ()) # 1970-01-01T00:01:00
# ISO 8601 date string input examples.
print ( ee . Date ( '2020' ) . format () . getInfo ()) # 2020-01-01T00:00:00
print ( ee . Date ( '2017-6-24' ) . format () . getInfo ()) # 2017-06-24T00:00:00
print ( ee . Date ( '2017-06-24' ) . format () . getInfo ()) # 2017-06-24T00:00:00
print ( ee . Date ( '2017-6-24T00:14:46' ) . format () . getInfo ()) # 2017-06-24T00:14:46
print ( ee . Date ( '2017-06-24T23:59:59' ) . format () . getInfo ()) # 2017-06-24T23:59:59
# With an optional time zone.
print ( ee . Date ( '2020' , 'US/Mountain' ) . format () . getInfo ()) # 2020-01-01T07:00:00
# Convert Python datetime.now() to Earth Engine Date
print ( ee . Date ( datetime . now ()) . format () . getInfo ())
ส่งความคิดเห็น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
หากต้องการบอกให้เราทราบเพิ่มเติม
[[["เข้าใจง่าย","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-07-26 UTC"],[],["The `ee.Date` function creates a new Date object, accepting various inputs: milliseconds since the epoch, ISO date strings, JavaScript Dates, or ComputedObjects. It can use numeric inputs, interpreted as milliseconds, or date strings following ISO 8601 format. An optional timezone argument (string) can be provided with string date input to specify the timezone. The function returns a Date object and examples in JavaScript and Python are provided.\n"]]