Can TimeSpan be humanized to years with Humanizer?

We want to use the Humanizer package (since we use it elsewhere) and do not want to add more similar libraries or manual code.

I have time intervals, some of which are thousands of days. I want to humanize them and transform them into years. Now I understand that the year is changing, but if I recount 10,000 days in several years, I am pleased with the loss of accuracy.

 TimeSpan.FromDays(10000).Humanize(minUnit: TimeUnit.Year);

returns

"no time"

TimeSpan.FromDays (10000) .Humanize ();

returns

"1428 weeks"

If I convert them to DateTimes, adding now.

DateTime.Today.Add(TimeSpan.FromDays(10000)).Humanize(); 

returns

"After 27 years"

It is always added from now on - can I remove a part from now in an integrated way?

+4
source share
1

, Humanizer TimeSpan . , , 365 366 .

, TimeSpan ( ), Humanizer , 365 366 .

# 604 , 365,25 . , , , .

+1

All Articles