सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए,
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
ee.Date.format
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
किसी तारीख को स्ट्रिंग में बदलें.
| इस्तेमाल | रिटर्न |
|---|
Date.format(format, timeZone) | स्ट्रिंग |
| आर्ग्यूमेंट | टाइप | विवरण |
|---|
यह: date | तारीख | |
format | स्ट्रिंग, डिफ़ॉल्ट: null | http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html पर बताया गया पैटर्न. अगर इसे शामिल नहीं किया जाता है, तो तारीख के लिए आईएसओ स्टैंडर्ड फ़ॉर्मैटिंग का इस्तेमाल किया जाएगा. |
timeZone | स्ट्रिंग, डिफ़ॉल्ट: null | टाइम ज़ोन (जैसे, 'America/Los_Angeles'); डिफ़ॉल्ट रूप से यूटीसी पर सेट होता है. |
उदाहरण
कोड एडिटर (JavaScript)
// Various examples of ee.Date.format with Joda-Time formatting and time zones.
var date = ee.Date('2020-08-18'); // Defaults to UTC
print(date); // Date (2020-08-18 00:00:00)
// List of time zones:
// https://www.joda.org/joda-time/timezones.html
print(date.format(null, 'GMT')); // 2020-08-18T00:00:00
print(date.format(null, 'Etc/GMT')); // 2020-08-18T00:00:00
print(date.format(null, 'Etc/GMT+0')); // 2020-08-18T00:00:00
print(date.format(null, 'Zulu')); // 2020-08-18T00:00:00
print(date.format(null, 'UTC')); // 2020-08-18T00:00:00
print(date.format(null, 'America/Los_Angeles')); // 2020-08-17T17:00:00
print(date.format(null, 'US/Pacific')); // 2020-08-17T17:00:00
print(date.format(null, 'Etc/GMT+8')); // 2020-08-17T17:00:00
print(date.format(null, 'PST8PDT')); // 2020-08-17T17:00:00
print(date.format(null, 'Australia/Tasmania')); // 2020-08-18T10:00:00
print(date.format(null, 'Etc/GMT-10')); // 2020-08-18T10:00:00
// Reference for Joda-Time format characters:
// https://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html
var datetime = ee.Date('1975-07-23T21:13:59'); // Defaults to UTC
print(datetime); // Date (1972-07-25 21:13:59)
// year of era and era
print(datetime.format('YYYY GG')); // 1975 AD
// century and year
print(datetime.format('CC YY')); // 19 75
// weekyear and week of weekyear
print(datetime.format('xxxx ww')); // 1975 30
// year and day of year
print(datetime.format('yy DDD')); // 75 204
// month of year and day of month
print(datetime.format('MM dd')); // 07 23
// day of week number and day of week text
print(datetime.format('e E')); // 3 Wed
print(datetime.format('e EEEEEEEE')); // 3 Wednesday
// half of day, hour of halfday, and clockhour of halfday
print(datetime.format('a K h')); // PM 9 9
print(datetime.format('a KK hh')); // PM 09 09
// hour of day, clockhour of day, minute, second, fraction of second
print(datetime.format('H k m s S')); // 21 21 13 59 0
print(datetime.format('HH kk mm ss SS')); // 21 21 13 59 00
// time zone
print(datetime.format('z')); // UTC
print(datetime.format('zzzz')); // Coordinated Universal Time
print(datetime.format('z', 'PST8PDT')); // PDT
print(datetime.format('zzzz', 'PST8PDT')); // Pacific Daylight Time
// time zone offset/id
print(datetime.format('Z')); // +0000
print(datetime.format('ZZ')); // +00:00
print(datetime.format('ZZZ')); // UTC
print(datetime.format('Z', 'PST8PDT')); // -0700
print(datetime.format('ZZ', 'PST8PDT')); // -07:00
print(datetime.format('ZZZ', 'PST8PDT')); // PST8PDT
// single quotes for text
print(datetime.format("YY 'yada' MM")); // 75 yada 07
// '' for a single quote
print(datetime.format("YY ''MM'' dd")); // 75 '07' 23
Python सेटअप करना
Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए,
Python एनवायरमेंट पेज देखें.
import ee
import geemap.core as geemap
Colab (Python)
# Various examples of ee.Date.format with Joda-Time formatting and time zones.
date = ee.Date('2020-08-18') # Defaults to UTC
display(date) # Date (2020-08-18 00:00:00)
# List of time zones:
# https://www.joda.org/joda-time/timezones.html
display(date.format(None, 'GMT')) # 2020-08-18T00:00:00
display(date.format(None, 'Etc/GMT')) # 2020-08-18T00:00:00
display(date.format(None, 'Etc/GMT+0')) # 2020-08-18T00:00:00
display(date.format(None, 'Zulu')) # 2020-08-18T00:00:00
display(date.format(None, 'UTC')) # 2020-08-18T00:00:00
display(date.format(None, 'America/Los_Angeles')) # 2020-08-17T17:00:00
display(date.format(None, 'US/Pacific')) # 2020-08-17T17:00:00
display(date.format(None, 'Etc/GMT+8')) # 2020-08-17T17:00:00
display(date.format(None, 'PST8PDT')) # 2020-08-17T17:00:00
display(date.format(None, 'Australia/Tasmania')) # 2020-08-18T10:00:00
display(date.format(None, 'Etc/GMT-10')) # 2020-08-18T10:00:00
# Reference for Joda-Time format characters:
# http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html
datetime = ee.Date('1975-07-23T21:13:59') # Defaults to UTC
display(datetime) # Date (1972-07-25 21:13:59)
# year of era and era
display(datetime.format('YYYY GG')) # 1975 AD
# century and year
display(datetime.format('CC YY')) # 19 75
# weekyear and week of weekyear
display(datetime.format('xxxx ww')) # 1975 30
# year and day of year
display(datetime.format('yy DDD')) # 75 204
# month of year and day of month
display(datetime.format('MM dd')) # 07 23
# day of week number and day of week text
display(datetime.format('e E')) # 3 Wed
display(datetime.format('e EEEEEEEE')) # 3 Wednesday
# half of day, hour of halfday, and clockhour of halfday
display(datetime.format('a K h')) # PM 9 9
display(datetime.format('a KK hh')) # PM 09 09
# hour of day, clockhour of day, minute, second, fraction of second
display(datetime.format('H k m s S')) # 21 21 13 59 0
display(datetime.format('HH kk mm ss SS')) # 21 21 13 59 00
# time zone
display(datetime.format('z')) # UTC
display(datetime.format('zzzz')) # Coordinated Universal Time
display(datetime.format('z', 'PST8PDT')) # PDT
display(datetime.format('zzzz', 'PST8PDT')) # Pacific Daylight Time
# time zone offset/id
display(datetime.format('Z')) # +0000
display(datetime.format('ZZ')) # +00:00
display(datetime.format('ZZZ')) # UTC
display(datetime.format('Z', 'PST8PDT')) # -0700
display(datetime.format('ZZ', 'PST8PDT')) # -07:00
display(datetime.format('ZZZ', 'PST8PDT')) # PST8PDT
# single quotes for text
display(datetime.format("YY 'yada' MM")) # 75 yada 07
# '' for a single quote
display(datetime.format("YY ''MM'' dd")) # 75 '07' 23
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-10-24 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-10-24 (UTC) को अपडेट किया गया."],[],["The `Date.format()` method converts a date to a string. It accepts a `format` string based on Joda-Time patterns and an optional `timeZone` string; if these arguments are omitted, the function will use default ISO formatting and UTC timezone. The method takes a date as input, and outputs a string representing the date, with specific formatting and time zone adjustments. The document also shows how to apply the formatting patterns.\n"]]