Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML | DOM Input DatetimeLocal type Property
Next article icon

HTML | <input type=”datetime-local”>

Last Updated : 14 Feb, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

The HTML <input type=”datetime-local”> is used to define a date and time control. The value must include the year, month, day and time.

Syntax:

<input type="datetime-local">

Example:




<!DOCTYPE html> 
<html> 
  
<head> 
    <title>
        HTML input type datetime-local
    </title>
      
    <style> 
        h1 { 
            color: green; 
        } 
          
        body { 
            text-align: center; 
        } 
    </style> 
</head> 
  
<body> 
  
    <h1>GeeksforGeeks</h1> 
      
    <h2> HTML <input type = "datetime-local"></h2> 
      
    <br> 
      
    Date Of Birth: 
    <input type="datetime-local" id="Test_DatetimeLocal"> 
</body> 
  
</html>
 
 

Output:

Supported Browsers: The browsers supported by <input type=”datetime-local”> are listed below:

  • Google Chrome 20.0
  • Internet Explorer 13.0
  • Opera 10.1
  • Firefox 93.0
  • Safari 14.1


Next Article
HTML | DOM Input DatetimeLocal type Property

M

manaschhabra2
Improve
Article Tags :
  • HTML
  • Web Technologies
  • HTML-Attributes

Similar Reads

  • HTML <input type="date">
    The HTML <input type="date"> element provides a date picker interface for selecting dates. It allows users to input dates using a calendar widget, ensuring standardized date input across different browsers and devices.  Syntax<input type="date">Example: In this example, the HTML <inpu
    1 min read
  • HTML <input> type Attribute
    The HTML <input> type Attribute is used to specify the type of <input> element to display. The default type of <input> type attribute is text. Syntax: <input type="value">Attribute Values: Name Description button Defines clickable button in HTML document, commonly activated w
    3 min read
  • HTML | DOM Input Datetime type Property
    The Input Datetime type property is used for returning the type of form element the datetime field is. The Input Datetime type property returns a string that represents the type of form element the datetime field is. Browsers such as Safari and Opera return "datetime" as a result whereas browsers su
    2 min read
  • HTML | DOM Input Datetime Object
    The Input Datetime Object in HTML DOM is used to represent an HTML input element with type= "datetime". The input element with type= "datetime" can be accessed by using getElementById() method. Syntax: It is used to access input Datetime object.document.getElementById("id");It is used to create inpu
    3 min read
  • HTML | DOM Input DatetimeLocal type Property
    The Input DatetimeLocal type property is used for returning the type of form element the datetimeLocal field is. The Input DatetimeLocal type property returns a string that represents the type of form element the datetimeLocal field is. Browsers such as Safari and Opera return "datetime-local" as a
    2 min read
  • HTML <input type="time">
    The HTML <input type="time"> element creates a time input field, allowing users to select a time (including hours and minutes) from a pre-defined list or by entering it manually. It provides a standardized way to input time values, enhancing user experience in forms that require time-based inp
    1 min read
  • HTML DOM Input Datetime list Property
    The input DateTime list property in HTML DOM is used to return a reference to the list element that contains an input DateTime field. Syntax: datetimeObject.list.idReturn value: It returns a string value that represents the value of the id attribute of the datalist element. Example:  Below HTML code
    1 min read
  • HTML | DOM Input Date type Property
    The Input Date type property is used for returning the type of form element the date field is. The Input Date type property returns a string that represents the type of form element the date field is. Syntax: inputdateObject.type Return Values: It returns a string value that represents the type of f
    1 min read
  • HTML <input type="month">
    The HTML <input type="month"> element creates a month picker, allowing users to select a specific month and year without specifying a day. It provides a standardized way to input month-based data to enhance user experience. Syntax<input type="month"> Example: This example demonstrate the
    1 min read
  • HTML | <input>max Attribute
    The HTML|<input> max Attribute is used to specify the maximum value for an input field. It can be used together with the min attribute to create a range of values. It can be used with the many input fields such as number, range, date, datetime, datetime-local, month, time and week. Syntax:
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences