What\'s the quickest and easiest way to get the Min (or Max) value between two dates? Is there an equivalent to Math.Min (& Math.Max) for dates?
I want to do som
How about a DateTime extension method?
DateTime
public static DateTime MaxOf(this DateTime instance, DateTime dateTime) { return instance > dateTime ? instance : dateTime; }
Usage:
var maxDate = date1.MaxOf(date2);