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

Wrong logic of DateTime.SpecifyKind #54

Open
Ali1Jamal opened this issue Sep 28, 2021 · 0 comments
Open

Wrong logic of DateTime.SpecifyKind #54

Ali1Jamal opened this issue Sep 28, 2021 · 0 comments

Comments

@Ali1Jamal
Copy link

Steps To Reproduce
https://dev.deck.net/9d292f241ded3180d8118d9bdb1e4edd

public class Program
{
    public static void Main()
    {
             DateTime date = DateTime.SpecifyKind(DateTime.Today, DateTimeKind.Utc);

            Console.WriteLine(date.ToString("u"));
    }
}

to compare:
https://dev.deck.net/4916fff18f204ff5d2e171dfbd1cbde9

Expected Result
2019-08-05 00:00:00Z
Actual Result

// Depending on time zone
UTC+1 - 2019-08-04 23:00:00Z
UTC+2 - 2019-08-04 22:00:00Z
etc

i think to fix this issues by change this line :
https://github.com/theolivenbaum/h5/blob/d9c8a733e6b55584c3bd37b1f461ae9378882550/H5/H5/shared/System/DateTime.cs#L734
with this :
return new DateTime(value.Ticks, kind);

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

No branches or pull requests

1 participant