Skip to content

jarlrasm/JarlTime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JarlTime

A simple .NET library for time.

Ideas

  • Separation of logic and presentation: Time struct ignores all information about timezones and calendars.
  • Testability: Inject context to your classes for different meanings of Now
  • Immutability
  • Simplicity?

Examples

If you like to inject code:

ITimeContext timeContext = new TimeContext();
Time time = timeContext.Now();
time=10.Days().And(10.Hours()).From(time);
Gregorian gregorian=time.Projection<Gregorian>(timeContext.Here());
int hour=gregorian.Hour;
string datestring=gregorian.ToString("yyyy MM dd");

If you are lazy

Time time = Rigth.Now;
Gregorian gregorian=time.Projection<Gregorian>(Rigth.Here)
...

About

A simple .NET library for time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages