DateTime dtStartDate, dtEndDate;
string uname = null;
string strStartDate, strEndDate;
if (txtStartDate.Text == "")
{
strStartDate = string.Format("{0:d}", Convert.ToDateTime("01-01-1900"));
}
else
{
strStartDate = string.Format("{0:d}", Convert.ToDateTime(txtStartDate.Text));
}
if (txtEndDate.Text == "")
{
strEndDate = string.Format("{0:d}", Convert.ToDateTime("01-01-2500"));
}
else
{
strEndDate = string.Format("{0:d}", Convert.ToDateTime(txtEndDate.Text));
}
dtStartDate = Convert.ToDateTime(strStartDate);
dtEndDate = Convert.ToDateTime(strEndDate);
strStartDate= dtStartDate.ToString("dd/MM/yyyy", new CultureInfo("en-US"))
strEndDate= dtEndDate.ToString("dd/MM/yyyy", new CultureInfo("en-US"))
No comments:
Post a Comment