splitforms.com

HTML · INPUT TYPE

HTML input type=datetime-local

Last reviewed

An <input type="datetime-local"> shows a date and time picker. It submits the user's local wall-clock time in the format yyyy-mm-ddTHH:mm, such as 2026-11-03T14:30. The date and time are joined with a literal T, and the value carries no time zone or offset. Seconds appear only when step is less than 60.

  • Live, editable example
  • Copy-paste snippet
  • Attributes & common mistakes
Live demo · nothing is sent

What gets submitted

Fill in the form above and press its button. The demo stops the request and lists every name=value pair the browser would send, plus the controls it leaves out.

With a free access key in the form, these fields land in your splitforms dashboard; access_key and botcheck are read by splitforms, not stored as lead data.

Edit the HTML and re-run it
Runs in a sandbox. Nothing is sent.

Minimal snippet

datetime-local-example.html
<input type="datetime-local" id="callback" name="callback_at"
       min="2026-11-03T09:00" max="2026-11-03T17:00" step="1800">

Copy-paste code

HTML input type=datetime-local code you can paste today.

Replace YOUR_ACCESS_KEY with a key from your free splitforms dashboard. The form posts to one endpoint — submissions land in your inbox and dashboard with spam filtering built in.

Get free access key
input-type-datetime-local.html
<form action="https://splitforms.com/api/submit" method="POST">
  <input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">

  <label for="name">Name</label>
  <input type="text" id="name" name="name" autocomplete="name" required>

  <label for="callback_at">Callback date and time</label>
  <input type="datetime-local" id="callback_at" name="callback_at"
         min="2026-11-03T09:00" max="2026-11-03T17:00" step="1800" required>

  <!-- Send the visitor's time zone so the server can build a real instant -->
  <input type="hidden" id="timezone" name="timezone">
  <script>document.getElementById("timezone").value = Intl.DateTimeFormat().resolvedOptions().timeZone;</script>

  <!-- Honeypot: hidden from people, bots fill it in -->
  <input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">

  <button type="submit">Request callback</button>
</form>

Attributes · <input type="datetime-local">

Which HTML input type=datetime-local attributes matter?

These attributes decide how the <input type="datetime-local"> behaves and what actually gets emailed to your inbox when someone submits.

HTML input type=datetime-local attributes and what each one does
AttributeWhat it doesDocs
nameThe key the value is sent under, such as callback_at. Without a name, the value is never sent.
minThe earliest allowed value, in the same yyyy-mm-ddTHH:mm format (such as 2026-11-03T09:00).MDN
maxThe latest allowed value, in the same yyyy-mm-ddTHH:mm format (such as 2026-11-03T17:00).MDN
stepThe step interval in seconds. The default is 60 (one minute). Use 1800 for 30-minute slots, or 1 for seconds.MDN
valueThe default value in yyyy-mm-ddTHH:mm format (such as 2026-11-03T14:30).MDN
requiredRequires a value to be chosen before the form can be submitted.MDN

Common mistakes

HTML input type=datetime-local not working? Here's why.

Most broken forms come down to a few small mistakes with the <input type="datetime-local">. Check these before you ship, then forward every submission to Slack or a webhook.

  1. The value has no time zone

    The submitted value is the user's local wall-clock time with no offset and no Z. The server cannot treat it as UTC. Send the time zone in a hidden field filled by JS, or convert to UTC on the client before submitting.

  2. The T separator and the seconds rule

    The date and time are joined with a literal T, and seconds appear only when step is less than 60. With the default step of 60 the value is always yyyy-mm-ddTHH:mm, never HH:mm:ss.

  3. type=datetime is obsolete

    The old type=datetime is obsolete and browsers render it as a plain text input. Use type=datetime-local for a real date and time picker.

  4. The time part looks different between browsers

    Firefox desktop supports datetime-local, but the time part of the picker looks different in each browser and follows the user's locale. The submitted value is the same fixed format everywhere.

Sources: WHATWG HTML Standard: <input type="datetime-local"> · MDN: <input type="datetime-local">

Copy-paste ready

The HTML input type=datetime-local example below is a complete, working form — paste it into any HTML page and it submits, no edits to the markup required.

No backend to build

Your html input type=datetime-local form posts to one endpoint. No server, PHP, or API route — accepted submissions are saved to your dashboard before owner notification email is attempted; delivery time and inbox placement depend on provider and recipient settings.

A form that really submits

Unlike a static reference snippet, this <input type="datetime-local"> form actually sends data to a free splitforms backend, with spam filtering built in.

How it works

How to add HTML input type=datetime-local to any page.

Copy the html input type=datetime-local example, drop in your free access key, and paste it into any page — submissions start landing in your dashboard.

Copy the code

Copy the HTML input type=datetime-local example below.

Add your access key

Replace YOUR_ACCESS_KEY with a free splitforms key from the dashboard.

Paste into your site

Drop the form into any HTML page. Submissions arrive in your dashboard.

How SplitForms works

What happens after someone submits your form?

splitforms receives the submission, filters spam, saves it to your dashboard and emails you — then, on paid plans, sends it on to your webhooks and integrations. No backend infrastructure to build.

A SplitForms contact form submission launching straight to your inbox

Add your endpoint

Point your form to your unique SplitForms endpoint. That's it.

HTML form pointing at a SplitForms submit endpoint

Receive submissions

We instantly capture and organize every submission in your inbox.

Submissions inbox with searchable leads and status pills

Route anywhere

Send data to email, spreadsheets, CRMs, webhooks, and 7,000+ apps.

Generic integration tiles for email, sheets, chat, CRM, automate, and webhook

No credit card required. Set up in under 60 seconds.

Connect & automate

Where can submissions go besides email?

On paid plans, submissions can also go to Slack, Discord, Google Sheets, Notion, Airtable, Zapier or any signed webhook — and splitforms works on the platforms you build on, from WordPress and Shopify to Next.js. With Stripe connected, your forms can take payments too.

Connect your SplitForms form to Slack, Google Sheets, Mailchimp, Zapier and more
NewTake payments on your formsDeposits, bookings, order forms — submitters check out through Stripe and the money goes straight to your Stripe account. Included on every paid plan.See payment forms →Need time slots? Online booking →

Setup guides for the stacks you use

Questions

HTML input type=datetime-local questions, answered.

View all FAQs
What does the backend receive from a datetime-local field?

A string like 2026-11-03T14:30, URL-encoded in the request body, so the colon arrives as %3A (2026-11-03T14%3A30) and the T stays as it is. The value has no time zone or offset, so the server cannot treat it as UTC.

How do I set the default value to now?

Build the value from the local date and time, not from toISOString(), which is UTC and can be a day off. Format the local year, month, day, hour and minute into yyyy-mm-ddTHH:mm and set it on the input's value in JavaScript.

Why does the value have no Z?

Because datetime-local captures the user's local wall-clock time, not a UTC instant. There is no offset to encode, so the value ends at the minute. If you need a real instant, send the time zone separately and combine them on the server.

How do I book appointments in 30-minute slots?

Set step="1800" on the input, because the step is in seconds and 1800 is 30 minutes. Set min to the start of the first slot so the steps line up, and check the value again on the server.

How do I convert the value to UTC on the server?

You cannot convert it without the time zone, because the value alone is only a wall-clock time. Send the zone in a hidden field filled with Intl.DateTimeFormat().resolvedOptions().timeZone, then on the server parse the value with that zone (for example with an IANA time zone database) to get the UTC instant.

Simple pricing

How much does splitforms cost?

Free gives you 500 submissions for $0 — no card, no time limit. Pro is $5/month for 5,000 submissions a month, and Annual is $49/year for 15,000 a month with every Pro feature.

Free

$0— 500 submissions
 

No card, no time limit

Best for testing

For side projects and indie devs.

  • 500 free submissions
  • Unlimited forms
  • Email notifications included
  • Smart spam filtering
  • Submissions dashboard
  • Redirect after submit
  • MCP server included

Annual

$49/ year
About $4.08 per month, billed yearly
Best value

Every Pro feature with triple the volume — $0.27 per 1,000 at full use.

  • 15,000 submissions per month
  • Unlimited forms
  • Everything in Pro
  • File uploads with 5 GB storage
  • 3 team seats
  • Priority email support

No credit card required on Free • Cancel anytime • Full pricing and FAQ