Skip to content

rbwestmoreland/system.clock

Repository files navigation

System.Clock

A testable alternative to DateTime.Now

Build status

Quick Start

PM> Install-Package System.Clock

Now use System.Clock.Now instead of System.DateTime.Now

Examples

//freeze time
System.Clock.Freeze(); 

//freeze at a specific time
System.Clock.Freeze(new DateTime(2012, 12, 21)); 

//return time to the present
System.Clock.Unfreeze(); 

Inspired by Ayende Rahien's SystemTime

About

A testable alternative to DateTime.Now

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published