You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i do DateTime.Now.AddDays(-1).Humanize() i get result as "23 hours ago" and not as yesterday which i have expected.
Am i doing anything wrong?
Also DateTime.Now.AddDays(1).Humanize() gives me result as not yet.
The text was updated successfully, but these errors were encountered:
The first instance gives you 23 hours ago because by the time humanizer gets to calculate the time the cpu has ticked past yesterday!! If you tried DateTime.Now.AddDays(-1).AddSeconds(-1) then you should get Yesterday as expected.
With regards to future dates that's the algorithm used by stackoverflow; but I agree it would be nice to get a similar result to the past dates. Will add that in. Thanks.
When i do DateTime.Now.AddDays(-1).Humanize() i get result as "23 hours ago" and not as yesterday which i have expected.
Am i doing anything wrong?
Also DateTime.Now.AddDays(1).Humanize() gives me result as not yet.
The text was updated successfully, but these errors were encountered: