Created
January 18, 2013 10:02
-
-
Save Larry57/4563563 to your computer and use it in GitHub Desktop.
Truncate milliseconds in a DateTime
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
| DateTime truncateMs(DateTime date) | |
| { | |
| return new DateTime((date.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment