static DateTime GetRandomDate(Random rand,
DateTime minDate, DateTime maxDate)
{
TimeSpan ts = maxDate - minDate;
int totalDays = (int)ts.TotalDays;
int randomDays = rand.Next(0, totalDays);
return minDate.AddDays(randomDays);
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment