Hi
<asp:DropDownList ID="ddlDates" class="form-control" DataTextFormatString="{0:dd/MM/yyyy}" required="true" runat="server" AutoPostBack="true" OnSelectedIndexChanged="Date_SelectedIndexChanged"> </asp:DropDownList>
DateTime? dtFrom = null;
DateTime PMDate2 = DateTime.ParseExact(ddlDates.SelectedItem.Value, "dd-MM-yyyy", System.Globalization.CultureInfo.InvariantCulture); dtFrom = Convert.ToDateTime(PMDate2.ToString("yyyy-MM-dd"));
Thanks