Jump to content

Datepicker in mm/dd/yy format


jackgoddy123

Recommended Posts

Hello,

   I have the below code with generate date format calender. It properly works for mm/dd/yy format

 

 

 

<html lang="en">

<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
 
<p>Date: <input type="text" id="datepicker"></p>
 
 
</body>
</html>

 

But i want datepicker in dd/mm/yy format. i.e 24/01/14 (dd/mm/yy) format

Can some one help me out. I am quite stuck.

Any kind of help is appreciated.

Link to comment
https://forums.phpfreaks.com/topic/285453-datepicker-in-mmddyy-format/
Share on other sites

A couple of minutes Googling gave

$(function() {
$( "#datepicker" ).datepicker({dateFormat: 'dd/mm/y'});
});

However, I prefer to use "d-M-y" format for datepickers. It's unambiguous about which is the month and which is the day (unlike 04/05/14) and it still works fine with strtotime() unlike d/m/y format

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.