How can I generate a random date that only has the number of the month and the year in a random way that comes in this EXAMPLE format "05/23" in c #?
CodePudding user response:
Random rnd = new Random();
int month = rnd.Next(1,12);
int year = rnd.Next(2000,2050);
string date = $"{month:D2}/{year:D2}";