Created
June 16, 2011 17:51
-
-
Save jonsagara/1029806 to your computer and use it in GitHub Desktop.
Abstracting DateTime.Now and DateTime.UtcNow
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 static class SystemTime | |
{ | |
public static Func<DateTime> Now = () => DateTime.Now; | |
public static Func<DateTime> UtcNow = () => DateTime.UtcNow; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Borrowed from Ayende: Dealing with time in tests