HTML5 Date and Time Picker Control

HTML5 forms use date and time controls regularly. HTML5 date and time controls are used by booking sites, scheduling events sites or flight arrivals scan sites. 

HTML5 Date and time control is useful in several ways. First, users can see day of the week while picking a date. Second, it prevents users from making a mistake in selecting proper date. For instance, some years have February 28th and not February 29th and some years have February 29th as valid dates. 

It is common to use JavaScript for date and time control, also known as date picker control. There are Ajax based frameworks that render date picker and bind it to the form field. However, there is no need to use any of that with HTML5. 

HTML5 has several controls that deal with date and time. They are different in appearances and behaviors. For example there are two different HTML5 controls for dates and time. 

HTML5 Date control:  <input type="date"/>
HTML5 Time control:  <input type="time"/>

In addition, HTML5 date picker control can be rendered as calendar pop-up control as shown on the picture below.

Some description
Pic. 1: HTML5 Calendar Control

There are other HTML5 date and time controls that allow flexibility for your online form when it comes to choosing dates. 

HTML5 month control: <input type="month"/>
HTML5 week control: <input type="week"/>

Sample code and HTML5 boilerplate file for four different HTML date and time control presented below: 

        <!DOCTYPE html>

                 <title>HTML5 Date and Time Control</title>

         <form id="myForm">

         <input type="date"/>
         <input type="time"/>
         <input type="datetime"/>
         <input type="month"/>
         <input type="week"/>


Featured pages


Learn about HTML5 architecture, design principles and patterns on HTML5 Overview Tutorial. Become …


Learn about HTML5 tags and discover a new list of HTML5 tags. Find out about HTML5 tags support by…


 Learn HTML5 development techniques, tips and tricks on our website. Find out what is required…

Date Time Picker

HTML5 forms use date and time controls regularly. HTML5 date and time controls are used by booking …