Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Convert a date to string.
Usage
Returns
Date.format(format, timeZone)
String
Argument
Type
Details
this: date
Date
format
String, default: null
A pattern, as described at http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html; if omitted will use ISO standard date formatting.
timeZone
String, default: null
The time zone (e.g., 'America/Los_Angeles'); defaults to UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-13 UTC."],[[["`ee.Date.format()` converts an Earth Engine `Date` object to a formatted string representation."],["The `format` argument uses Joda-Time formatting patterns for customization."],["The `timeZone` argument, if provided, adjusts the output to the specified time zone; defaults to UTC."],["If `format` is omitted, the ISO standard date formatting is used."],["Joda-Time formatting patterns provide flexible options to display various date and time components, including year, month, day, hour, minute, second, time zone, and more."]]],["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"]]