Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Releases

No releases published

Packages

No packages published