Skip to content

Instantly share code, notes, and snippets.

@frankgeerlings
Created April 12, 2012 09:28
Show Gist options
  • Save frankgeerlings/2365821 to your computer and use it in GitHub Desktop.
Save frankgeerlings/2365821 to your computer and use it in GitHub Desktop.
Substitutable DateTime.Now
private static Func<DateTime> now = () => DateTime.Now;
public static Func<DateTime> Now
{
get
{
return now;
}
set
{
now = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment