DateTime
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Rappresentazione JSON |
{
"date": string
} |
Campi |
date |
string
Data e ora di un formato esteso ISO 8601. L'offset può essere o meno necessario (fai riferimento alla documentazione del campo principale). Il tempo può essere specificato con una precisione fino a nanosecondi. Gli offset possono essere specificati con la precisione in secondi (anche se i secondi di offset non fanno parte di ISO 8601). Ad esempio: 1985-04-12T23:20:50.52Z sarebbe 20 minuti e 50, 52 secondi dopo la 23a ora del 12 aprile 1985 in UTC.
1985-04-12T19:20:50.52-04:00 corrisponderebbe a 20 minuti e 50, 52 secondi dopo la 19a ora del 12 aprile 1985, 4 ore prima del fuso orario UTC (stesso istante dell'esempio riportato sopra). Se la data e l'ora si riferiscono a una località fisica a New York, corrispondono all'ora legale orientale. Ricorda che l'offset varia nelle regioni che osservano l'ora legale (o ora legale), a seconda del periodo dell'anno.
1985-04-12T19:20:50.52 sarebbe 20 minuti e 50, 52 secondi dopo la 19a ora del 12 aprile 1985 senza informazioni sull'offset.
L'invio di un offset lo rende un momento assoluto nel tempo in tutto il mondo. La data e l'ora vengono regolate in base al fuso orario dell'utente. Ad esempio, 2018-06-19T18:30:00-04:00 saranno le 18:30:00 per gli utenti di New York e le 15:30:00 per gli utenti di Los Angeles. Se ometti l'offset, viene applicata una data/ora locale, che rappresenta diversi istanti nel tempo in tutto il mondo. La data e l'ora sono sempre riferite al fuso orario corrente dell'utente. Ad esempio, l'orario 2018-06-19T18:30:00 sarà 18:30:00 per un utente di New York e anche 18:30:00 per un utente di Los Angeles. Ciò è utile quando la stessa data e ora locale deve essere applicata a molte sedi fisiche in diversi fusi orari.
|
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 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. |"]]