Generating Random date and time.

Bageshkumarbagi
Posted by Bageshkumarbagi under C# category on | Points: 40 | Views : 603
private void button1_Click(object sender, EventArgs e)
{
DateTime dt = new DateTime();
dt=DateTime.Now.AddDays(new Random().Next(1000));
MessageBox.Show(dt.ToString());

}

Comments or Responses

Login to post response