إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.Date.fromYMD
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض هذه الدالة تاريخًا محدّدًا باستخدام القيم المُدخلة للسنة والشهر واليوم.
الاستخدام | المرتجعات |
---|
ee.Date.fromYMD(year, month, day, timeZone) | التاريخ |
الوسيطة | النوع | التفاصيل |
---|
year | عدد صحيح | على سبيل المثال، العام 2013. |
month | عدد صحيح | الشهر، 3 مثلاً |
day | عدد صحيح | اليوم، 15 مثلاً |
timeZone | سلسلة، القيمة التلقائية: null | المنطقة الزمنية (مثلاً 'America/Los_Angeles')، ويتم ضبطه تلقائيًا على التوقيت العالمي المتفق عليه. |
أمثلة
محرّر الرموز البرمجية (JavaScript)
print('Date with default UTC',
ee.Date.fromYMD(2021, 4, 30));
print('Date with time zone specified',
ee.Date.fromYMD(2021, 4, 30, 'America/Los_Angeles'));
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
display('Date with default UTC:', ee.Date.fromYMD(2021, 4, 30))
display(
'Date with time zone specified:',
ee.Date.fromYMD(2021, 4, 30, 'America/Los_Angeles')
)
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003e\u003ccode\u003eee.Date.fromYMD\u003c/code\u003e creates a Date object from year, month, and day inputs.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts optional \u003ccode\u003etimeZone\u003c/code\u003e argument to specify the time zone, defaulting to UTC if not provided.\u003c/p\u003e\n"],["\u003cp\u003eYou can use this function in both JavaScript and Python environments within Google Earth Engine.\u003c/p\u003e\n"]]],["The function `ee.Date.fromYMD` constructs a Date object using year, month, and day inputs, all of which are integers. Optionally, a `timeZone` string can be provided; otherwise, it defaults to UTC. The function returns a Date object. Examples are provided for both JavaScript and Python, demonstrating usage with and without specifying a time zone. The Python examples require the `ee` and `geemap` libraries.\n"],null,["# ee.Date.fromYMD\n\nReturns a Date given year, month, day.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------------------|---------|\n| `ee.Date.fromYMD(year, month, day, `*timeZone*`)` | Date |\n\n| Argument | Type | Details |\n|------------|-----------------------|---------------------------------------------------------------|\n| `year` | Integer | The year, 2013, for example. |\n| `month` | Integer | The month, 3, for example. |\n| `day` | Integer | The day, 15, for example. |\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\nprint('Date with default UTC',\n ee.Date.fromYMD(2021, 4, 30));\n\nprint('Date with time zone specified',\n ee.Date.fromYMD(2021, 4, 30, 'America/Los_Angeles'));\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\ndisplay('Date with default UTC:', ee.Date.fromYMD(2021, 4, 30))\n\ndisplay(\n 'Date with time zone specified:',\n ee.Date.fromYMD(2021, 4, 30, 'America/Los_Angeles')\n)\n```"]]