Introduction
There are many more examples on the Internet for jQuery Datepicker. Manyprogrammers widely using jQuery Datepicker and in this article I will teach you some of the basics of jQuery Datepicker Date Format.! Let's start.
JQuery Reference
You must use the following jquery reference in your HTML Code, otherwise it will not work.
There are many more examples on the Internet for jQuery Datepicker. Manyprogrammers widely using jQuery Datepicker and in this article I will teach you some of the basics of jQuery Datepicker Date Format.! Let's start.
JQuery Reference
You must use the following jquery reference in your HTML Code, otherwise it will not work.
- <head>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- </head>
Jquery Datepicker With Different Format
Firstly, read the JQuery Documentation because the documentation
explains the basic details of jQuery Datepicker Format. For example, DD and dd will give different output.
Check the following details that are provided in the jQuery documentation.
- d - day of month (no leading zero)
- dd - day of month (two digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
Example 1: jQuery Datepicker Format ( dd/mm/yy ).
HTML
- Date : <input id="Datepicker" type="text" /><br />
The following code is using textbox id "#Datepicker" and dateFormat "dd/mm/yy". You can change this format based on your requirement like "mm/dd/yy".
- $(function () {
- $('#Datepicker').datepicker({
- dateFormat: 'dd/mm/yy'
- });
- })
JS Fiddle Demo 1: http://jsfiddle.net/rajeeshmenoth/en2c6124/
Example 2 : jQuery Datepicker Format ( dd MM yy )
HTML
- Date : <input id="Datepicker" type="text" /><br />
JQuery
The format will display like 26 August 1989.
- $(function () {
- $('#Datepicker').datepicker({
- dateFormat: 'dd MM yy'
- });
- })
JS Fiddle Demo 2: http://jsfiddle.net/rajeeshmenoth/tnystokr/
Example 3 : Day of the year
HTML
- Date : <input id="Datepicker" type="text" /><br />
JQuery
The dateFormat using "o", it will count the day of the year.
- $(function () {
- $('#Datepicker').datepicker({
- dateFormat: 'o'
- });
- })
Output
JS Fiddle Demo 3: http://jsfiddle.net/rajeeshmenoth/fn1fd30s/.
Reference
Summary
We learned various date format in jQuery Datepicker. I hope this article is useful for beginners.


Viknaraj ManogararajahTOP 100Posted Aug 6, 2018, 2:56 PM EDT
nice article...
Rajeesh MenothPosted Aug 30, 2016, 12:31 AM EDT
Thank You Delpin Susai Raj
Delpin Susai RajTOP 100Posted Aug 28, 2016, 3:09 AM EDT
Nice article
Rajeesh MenothPosted Sep 23, 2015, 2:24 AM EDT
Thanks Santhakumar Munuswamy sir
Santhakumar MunuswamyPosted Sep 22, 2015, 11:12 AM EDT
Nice Article. Thanks for sharing
Rajeesh MenothPosted Sep 21, 2015, 10:14 PM EDT
Thanks bro Anil Kumar
Anil KumarPosted Sep 21, 2015, 10:11 PM EDT
Nyc 1 Bro..
Karthikeyan KPosted Sep 21, 2015, 7:41 PM EDT
Good one bro-:)
Pankaj Kumar ChoudharyTOP 100Posted Sep 21, 2015, 4:46 PM EDT
Nice Explain Sir..........
RakeshPosted Sep 21, 2015, 6:16 AM EDT
Good share
Nilesh JadavPosted Sep 21, 2015, 2:30 AM EDT
Nice one Buddy :)
Ankit BansalPosted Sep 21, 2015, 2:15 AM EDT
good one...
Siddarth PathakPosted Sep 20, 2015, 11:44 PM EDT
good.
Sumit JoshiPosted Sep 20, 2015, 11:26 PM EDT
Thanks for sharing...
Sibeesh VenuTOP 100Posted Sep 20, 2015, 11:23 PM EDT
Nice Share :)
Saritha K TPosted Sep 20, 2015, 10:29 PM EDT
nice article.............