C# 中 double 型数值与 DateTime 的相互转换
程序员文章站
2024-01-06 08:27:04
...
double n = 0;
DateTime origintime = DateTime.FromOADate(0);
// origintime.ToString()等于“1899-12-30 0:00:00”
while (DateTime.FromOADate(n) != Command.Win.dp_date.SelectedDate)
{
n += 1;
}
//TaskDialog.Show("test", DateTime.FromOADate(n).ToShortDateString());
TaskDialog.Show("test", n.ToString());