How to change date format using jquery in asp.net?
-
I want to change date format using jquery when user select date then text box contain date as yy/mm/dd format I was write some code hear <script src="content/dist/js/jquery-1.8.3.js" type="text/javascript"></script> <script src="content/dist/js/jquery.ui.datepicker.js" type="text/javascript"></script> <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> <script type="text/javascript"> $(document).ready(function () { $("[id$=txtDate]").datepicker({dateFormat: 'yy/mm/dd'}); }); </script> aspx code : <asp:TextBox ID="txtDate" CssClass="form-control" runat="server" placeholder="Enter Date" TabIndex="7" ></asp:TextBox>
-
Answer:
You can change the format in c#. Use this code : txtDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
jayesh dhameliya at Stack Overflow Visit the source
Related Q & A:
- How to Search using jQuery ASP.Net?Best solution by Stack Overflow
- How to change the format of an email?Best solution by Yahoo! Answers
- How to change video format?Best solution by Yahoo! Answers
- How to change date & time settings of yahoomail?Best solution by Yahoo! Answers
- Is there some kind of API for MSN protocol (for using in C# asp.net application?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.