Answers for "how to generate a random date in c#"

C#
0

c# generate random date

private Random gen = new Random();
DateTime RandomDay()
{
    DateTime start = new DateTime(1995, 1, 1);
    int range = (DateTime.Today - start).Days;           
    return start.AddDays(gen.Next(range));
}
Posted by: Guest on April-16-2021

Code answers related to "how to generate a random date in c#"

C# Answers by Framework

Browse Popular Code Answers by Language