convett date time
string dateTime = DateTime.Now.ToShortDateString();
DateTime dtdateTime = Convert.ToDateTime(dateTime);
CultureInfo currentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
if (System.Configuration.ConfigurationSettings.AppSettings["ClientDateFormat"] != null)
{
currentCulture.DateTimeFormat.ShortDatePattern =
System.Configuration.ConfigurationSettings.AppSettings["ClientDateFormat"];
}
else
{
currentCulture.DateTimeFormat.ShortDatePattern =
CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
}
string stringdtdateTime = dtdateTime.ToString(currentCulture.DateTimeFormat.ShortDatePattern);
DateTime dtdateTimeOutPut = Convert.ToDateTime(stringdtdateTime, currentCulture);
string dt = dtdateTimeOutPut.ToString("MM/dd/yy", DateTimeFormatInfo.InvariantInfo);
string xcv = "";
0 Response to "convett date time"
Post a Comment