DateTime
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Representación JSON |
{
"date": string
} |
Campos |
date |
string
Una fecha y hora de formato extendido ISO 8601. El desplazamiento puede ser obligatorio o no (consulta la documentación del campo superior). El tiempo se puede especificar con una precisión de nanosegundos. Los desplazamientos se pueden especificar con precisión de segundos (aunque los segundos de desplazamiento no formen parte de ISO 8601). Por ejemplo: 1985-04-12T23:20:50.52Z serían 20 minutos y 50.52 segundos después de la hora 23 del 12 de abril de 1985 en UTC.
1985-04-12T19:20:50.52-04:00 estaría 20 minutos y 50.52 segundos después de la hora 19 del 12 de abril de 1985, 4 horas antes de UTC (mismo tiempo que el ejemplo anterior). Si la fecha y la hora corresponden a una ubicación física en Nueva York, serían el equivalente a la hora de verano del este (EDT). Recuerde que la compensación varía en las regiones que respetan el horario de verano, según la época del año.
1985-04-12T19:20:50.52 estaría 20 minutos y 50.52 segundos después de la hora 19 del 12 de abril de 1985 sin información de compensación.
Proporcionar un desplazamiento hace que esto sea un instante absoluto en el mundo. La fecha y la hora se ajustarán en función de la zona horaria del usuario. Por ejemplo, la hora 2018-06-19T18:30:00-04:00 será 18:30:00 para un usuario de Nueva York y 15:30:00 para un usuario de Los Ángeles. Si se omite el desplazamiento, se convierte en una fecha y hora local, que representa varios instantes en el tiempo alrededor del mundo. La fecha y la hora siempre estarán en la zona horaria actual del usuario. Por ejemplo, la hora 2018-06-19T18:30:00 será 18:30:00 para un usuario de Nueva York y 18:30:00 para un usuario de Los Ángeles. Esto resulta útil cuando se aplica la misma fecha/hora local a muchas ubicaciones físicas en varias zonas horarias.
|
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-25 (UTC)
[null,null,["Última actualización: 2025-07-25 (UTC)"],[[["\u003cp\u003eThe JSON schema represents a date object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edate\u003c/code\u003e field is a string that adheres to the ISO 8601 extended format for date and time.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edate\u003c/code\u003e field can include an offset to specify the time zone, or it can be omitted for local time representation.\u003c/p\u003e\n"],["\u003cp\u003eProviding an offset ensures the \u003ccode\u003edate\u003c/code\u003e represents a specific instant in time globally, while omitting it makes it a local time subject to user time zones.\u003c/p\u003e\n"]]],["The core information defines the `date` field within a JSON structure. The `date` is a string representing an ISO 8601 date/time, with optional offset information. It may include nanosecond precision. Providing an offset creates an absolute instant in time, adjusted to the user's timezone. Omitting the offset creates a local date/time, consistent across time zones. This format can represent times down to the nanosecond and offsets with second precision.\n"],null,["# DateTime\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\n| JSON representation |\n|----------------------------|\n| ``` { \"date\": string } ``` |\n\n| Fields ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `date` | `string` An ISO 8601 extended format date/time. Offset may or may not be required (refer to the parent field's documentation). Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601). For example: `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the date/time is intended for a physical location in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year. `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information. Providing an offset makes this an absolute instant in time around the world. The date/time will be adjusted based on the user's time zone. For example, a time of `2018-06-19T18:30:00-04:00` will be 18:30:00 for a user in New York and 15:30:00 for a user in Los Angeles. Omitting the offset makes this a local date/time, representing several instants in time around the world. The date/time will always be in the user's current time zone. For example, a time of `2018-06-19T18:30:00` will be 18:30:00 for a user in New York and also 18:30:00 for a user in Los Angeles. This is useful when the same local date/time should apply to many physical locations across several time zones. |"]]