CSharp examples for System:DateTime Calculate
A DateTime extension method that query if '@this' is morning.
// Licensed under MIT License (MIT) (https://github.com/zzzprojects/Z.ExtensionMethods) using System;//from www . java2 s .co m public class Main{ /// <summary> /// A DateTime extension method that query if '@this' is morning. /// </summary> /// <param name="this">The @this to act on.</param> /// <returns>true if morning, false if not.</returns> public static bool IsMorning(this DateTime @this) { return @this.TimeOfDay < new DateTime(2000, 1, 1, 12, 0, 0).TimeOfDay; } }