Wednesday, March 28, 2007

Convert String To Formatted Date and Time

private void Form1_Load(object sender, System.EventArgs e){
DateTime dt;
string InputDateString = "20070328";
 int iYear =
  int iMonth =
 int iDay =
dt = new DateTime(iYear, iMonth, iDay);
MessageBox.Show(dt.Year+" "+dt.Month+", "+dt.Day);
//Change Any Format As You Like It

No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.