Skip to content

Instantly share code, notes, and snippets.

@jonsagara
Created June 16, 2011 17:51
Show Gist options
  • Save jonsagara/1029806 to your computer and use it in GitHub Desktop.
Save jonsagara/1029806 to your computer and use it in GitHub Desktop.
Abstracting DateTime.Now and DateTime.UtcNow
public static class SystemTime
{
public static Func<DateTime> Now = () => DateTime.Now;
public static Func<DateTime> UtcNow = () => DateTime.UtcNow;
}
@jonsagara
Copy link
Author

Borrowed from Ayende: Dealing with time in tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment