Created
October 12, 2017 16:01
-
-
Save ryanwebjackson/81fdf3d843bcef416471d7abfdcd613b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
private DateTime? FloorDatetimeToDayPrecision(DateTime? inDatetime) | |
{ | |
if (inDatetime.HasValue && inDatetime.Value.TimeOfDay > TimeSpan.MinValue) | |
{ | |
var oldDatetime = inDatetime.Value; | |
return new DateTime(oldDatetime.Year, oldDatetime.Month, oldDatetime.Day, 0, 0, 0); | |
} | |
else | |
{ | |
return inDatetime; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment