Double to DateTime
// convert Double to DateTime
double d = 38670.333333333336;
// dt is now a .NET date time
// convert DateTime
DateTime dt = DateTime.FromOADate(d);
this.textBox1.Text = String.Format("{0:MMM dd, yyyy HH:mm}", dt);
DateTime to Double
// convert DateTime to Double
string st = "2006-12-12";
// dt is now a .NET date time
DateTime dt = DateTime.Parse(st.ToString());
// convert double
double d = Convert.ToDouble(dt.ToOADate());
this.textBox1.Text = d.ToString();
Wednesday, May 21, 2008
Subscribe to:
Post Comments (Atom)
2 comments:
Es war sehr nützlich
muchas gracias me sirvio muchooo
gracias nuevamente
Post a Comment