Whenever i choose the date from datepicker the date will flip with month position.
i tried to convert the date format from dd/MM/yyyy to MM/dd/yyyy and reverse also but the selected date is flipping the date to month.
$(function () {
$("#<%= txtDatePicker.ClientID %>").datepicker({
autoclose: true,
dateFormat: "dd/MM/yyyy"
});
$("#<%= txtDatePicker1.ClientID %>").datepicker({
autoclose: true,
dateFormat: "dd/MM/yyyy"
});
});
C# code is
var dateAndTime = Convert.ToDateTime(txtDatePicker.Text);
var date = dateAndTime.Date;
Or try to converted to string and change the format
string d1 =txtDatePicker.Text;
d1.ToString("dd/MM/yyyyy")
nothing helps.
if i want to choose the date between 01-Aug-2019 and second date 29-Sep-2019.