// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { public class Program { public static DateTime D(int m, int d) { DateTime now = DateTime.Now; int y = now.Year; if(m < now.Month || (m == now.Month && d < now.Day)) { y++; } return new DateTime(y, m, d); } public static void Main(string[] args) { Console.WriteLine(D(12, 27)); Console.WriteLine(D(12, 25)); Console.WriteLine(D(2, 29)); } } }