Value formats
What format does each date and time input submit?
Each type submits one fixed string format from the HTML Standard, the same in every browser and locale; only the on-screen display follows the user's locale. A blank or half-typed field submits an empty string. The examples use 2 October 2026 at 14:30.
| type | Submitted value | Example | valueAsNumber | valueAsDate |
|---|---|---|---|---|
date | yyyy-mm-dd | 2026-10-02 | Milliseconds from 1970-01-01 to that day's UTC midnight: 1790899200000 | That day at UTC midnight |
time | HH:mm, plus :ss or :ss.sss when seconds are set | 14:30 | Milliseconds since midnight: 52200000 | 1970-01-01 at that time, in UTC |
datetime-local | yyyy-mm-ddTHH:mm, plus :ss when the seconds are not zero | 2026-10-02T14:30 | Milliseconds from 1970-01-01T00:00, reading the value as if it were UTC: 1790951400000 | null: it does not apply to this type |
month | yyyy-mm | 2026-10 | Months since January 1970, not milliseconds: 681 | The 1st of the month at UTC midnight |
week | yyyy-Www, an ISO 8601 week that starts on Monday | 2026-W40 | Milliseconds to 00:00 UTC on the week's Monday: 1790553600000 | That Monday at UTC midnight |
Every valueAsDate is a UTC moment, so format it with timeZone: "UTC"; otherwise 2026-10-02 displays as 1 October anywhere west of UTC. A time value has no date and a datetime-local value has no time zone, so send the visitor's zone with it when the exact moment matters.
Sources: WHATWG HTML Standard: date and time microsyntaxes · WHATWG: date state · WHATWG: time state · WHATWG: local date and time state · WHATWG: month state · WHATWG: week state · MDN: valueAsNumber




