Hello,
I am using simple asp:calender to select date and i want date in dd/mm/yyyy format
My code :
<asp:Calendar runat="server" ID="clinvoicedate">
<SelectedDayStyle BackColor="#F4F4F4" ForeColor="Maroon" />
<TodayDayStyle BackColor="#000000" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#CCCCCC" />
<DayHeaderStyle BackColor="#E9E9E9" />
<DayStyle BorderColor="#286090" BorderStyle="Solid" BorderWidth="2px" />
<TitleStyle BackColor="White" ForeColor="Black" />
</asp:Calendar>
And in code behind i am trying to get dd/mm/yyyy format.
My code nehind :
string idate = DateTime.Parse(clinvoicedate.SelectedDate.ToString()).ToString("dd/mm/yyyy", CultureInfo.InvariantCulture);
but it gives format as - dd-00-yyyy.
e.g. - if i have selected date 2 march 2018 then the result of above conversion is - 02-00-2018
where as i want it as - 02/03/2018
Thanks in advance