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

Natural culture give wrong ui date format in Windows server 2022/2019 #58564

Open
1 task done
amdnaji opened this issue Oct 22, 2024 · 1 comment
Open
1 task done

Natural culture give wrong ui date format in Windows server 2022/2019 #58564

amdnaji opened this issue Oct 22, 2024 · 1 comment

Comments

@amdnaji
Copy link

amdnaji commented Oct 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

I have a Razor project and everything was working fine until I decided to upgrade the server from 2016 to 2022 , After upgrading I noticed that .Net accept Hijri date as Gregorian date, for example I have form contain date input filed and If send Hijri date let say (1446/04/19) the .Net will treat this date as Gregorian date not Hijri date. I tried to run the project in different server but this time Windows Server 2016 and i got the expected behavior

Expected Behavior

After configure the localization I tried to print the current Date in the page using DateTime.Now.ToString("yyyy/MM/dd") and instead of printing Hirji date it print Gregorian date which is not the right or expected behavior

Steps To Reproduce

Please clone this Repo and try to run the app in Windows server 2016 and 2022 to see the difference

Image from windows server 2022

Image

Image from windows server 2016

Image

Exceptions (if any)

No response

.NET Version

+6

Anything else?

No response

@martincostello
Copy link
Member

Looks like this issue should be transferred to dotnet/runtime as it doesn't appear to be specific to ASP.NET Core.

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

2 participants