Last post Sep 04, 2019 12:10 PM by PatriceSc
Aug 31, 2019 05:28 PM|Lucifer_deep|LINK
On a new project I received from a client(UK), I have a date and time picker from textbox, this is working on their local machines and time systems(even production). But unfortunately, as I am in India, it does not work on my machine and returns error "
This happens even when I turn my timezone to UK. I think it is not a code error as it is working on their machines and servers. Can anyone give me a proper fix on this.
Aug 31, 2019 06:24 PM|mgebhard|LINK
The issue is not the timezone. Date formats are different across cultures. This is configured when first setup your computer.
The standard DateTime documents explain the concept.
Sep 02, 2019 08:44 AM|Yang Shen|LINK
The value 08/31/2019 17:21 is invalid
According to this error message, you might need to change the date related information you get from your datepicker.
You can use like .ToString("d") or other method you can find to change this data into a valid one in your country.
For more information, you can refer to
this article in MSDN.
Sep 03, 2019 12:47 PM|Lucifer_deep|LINK
The difference I think is between the culture. As mgebhard suggested, but when I change my system time to UK format, I get an build errors and in the normal time(IST time) it runs with that issue. Need to find a work around for that.
Sep 03, 2019 01:07 PM|mgebhard|LINK
I recommend contacting your client and asking for help understanding the design as related to culture. The last thing you want to do is create a "Work Around" that breaks the design intent.
Sep 04, 2019 11:55 AM|Lucifer_deep|LINK
The project is mostly used in UK and used only UST as their time zone. I need to make it work from my end. I tried changing my system time, etc, but everything failed. Any suggestions on how to make this work on my machine. As you said, "Work Around" is
not an option here. This sounds to be a configuration issue. Need to check it more.
Sep 04, 2019 12:08 PM|mgebhard|LINK
Keep in mind, that you have not shared any code. The only item shared is a validation error. I assume this is a user error where you are not entering the expected date format. IMHO, you should know how to enter a date since you have the validation logic,
Again, I recommend that you contact the client for assistance. The client should be able to explain the validation requirements. Otherwise, share enough code to reproduce this issue and include the steps to reproduce the issue.
Sep 04, 2019 12:10 PM|PatriceSc|LINK
AFAIK UK uses dd/MM/yyyy rather than MM/dd/yyyy which is for US. What if you try 31/08/2019 5:21 PM rather than 08/31/2019 17:21 (or this the format for your own culture?)
It could be also that they are hosting on a UK server and never noticed an issue.
If a site is intended for a single culture, IMO the first step would be to use https://www.c-sharpcorner.com/article/globalization-using-Asp-Net/ to configure the server
side to always use the intented culture regardless of particular server settings.
Then you may have to solve a client side if the app doesn't handle this as well. It is still useful to make 100% sure their intent is to make this site always use the UK culture for everything...