// 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; class MainClass { public static bool WithinLastWeek(string s) { DateTime t = DateTime.Parse(s); return ((t <= DateTime.Now) && (t >= DateTime.Now.AddDays(-7))); } public static void Main(string[] args) { Console.WriteLine(WithinLastWeek("15/11/2003")); Console.WriteLine(WithinLastWeek("15/10/2003")); } }