Answers for "c# random date"

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

C# Answers by Framework

Browse Popular Code Answers by Language