The default format of datepicker is [MM/dd/yy].Even if i change the system date format like [dd/MM/yyy] datepicker takes a default format i.e [MM-dd-yy]. How to set datepicker format according to system datetime format.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="Stylesheet" type="text/css" /> <script type="text/javascript"> $(function () { $("[id$=txtDate]").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'http://jqueryui.com/resources/demos/datepicker/images/calendar.gif', dateFormat: 'dd/mm/yy' }); }); </script> <input type = "text" id = "txtDate" />
Demo
There is no System Default Format like stuff. You can accept Date in any format and convert it to DateTime
string s = "05/01/2013"; DateTime d = DateTime.ParseExact(s, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.