Last active
June 15, 2016 02:24
-
-
Save jsgao0/bd11200790f2ed89d7b77edfffe1625e to your computer and use it in GitHub Desktop.
C# Datetime Comparison
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DTC { // DateTimeComparison | |
public static bool lgr(DateTime a, DateTime b, bool isEqual = false) { // Left Datetime a is greater than right Datetime b. If isEqual is true then return true when the 2 Datetimes both are same. | |
int result = DateTime.Compare(a, b); | |
return isEqual ? (result >= 0) : (result > 0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment