Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime.Humanize should respect Kind #941

Closed
wojciechrak opened this issue Jun 1, 2020 · 0 comments · Fixed by #967
Closed

DateTime.Humanize should respect Kind #941

wojciechrak opened this issue Jun 1, 2020 · 0 comments · Fixed by #967

Comments

@wojciechrak
Copy link

Humanizer version 2.8.11
My timezone: CEST (UTC +02:00)

Excerpt from C# interactive:

> DateTime.Now
[6/1/2020 4:15:51 PM]
> DateTime.Now.Kind
Local
> DateTime.Now.Humanize()
"2 hours from now"
> DateTime.UtcNow
[6/1/2020 2:16:01 PM]
> DateTime.UtcNow.Humanize()
"now"
> DateTime.Now.Humanize(false)
"now"

I don't understand, why DateTime.Now.Humanize() would return "2 hours from now".
I assume it compares it to Utc time, but what about the Kind property?
The default behavior (not specyfing bool utcDate), should use the Kind property to set this flag true/false.

@iskcal iskcal mentioned this issue Aug 23, 2020
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant