Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to get and format the date in asp.net using JQuery

Tags: format jquery
As per previous articles we have seen how to get the data from the web controls using Jquery. Here  we will know how Format and add the days to desired date in JQuery.

The below piece of code will get the current date and add days(Here 7days) using Jquery.There is one more functionality also included to get the date in a specific format using Date picker function

<asp:Label id="Label1"  Text="Date" runat="server"/>
<asp:TextBox ID="txtDate" runat="server"/>
<asp:Button id="CalDuration" >Calculate</asp:Button></br />





$("#txtDate").datepicker({ dateFormat: 'mm/dd/yy' });
$('#CalDuration').on('click', function(){
var $date = $('#txtDate').datepicker("getDate");
var resDate = new Date();

resDate.setDate($date.getDate() + 7);
alert(resDate.toString());


This post first appeared on Aspdotnet-Sharepoint, please read the originial post: here

Share the post

How to get and format the date in asp.net using JQuery

×

Subscribe to Aspdotnet-sharepoint

Get updates delivered right to your inbox!

Thank you for your subscription

×