📜  c# 日历按钮随机日期 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:00.907000             🧑  作者: Mango

代码示例1
DateTime RandomDay()
    {
        DateTime start = new DateTime(1900, 1, 1);
        Random gen = new Random();

        int range = (DateTime.Today - start).Days;           
        return start.AddDays(gen.Next(range));
    }