What happens if I set CurrentCultureInfo to en-us
I am using a client application that connects to a remote US database. there are some datetime ambiguities that appear as a result, as if the date was January 14th in the database, it returned as January 13th.
What I would like to know If I set my Client's CurrentCultureInfo equal to my servers, this will fix the problem.
If it can be done ... I would like a small example of the same.
If you can't change the storage date in UTC and convert back and forth when inserting and selecting data. Then, if your data is not inserted into the server, you will have to write something that tells you where the data came from (I mean the local timezone of the client that inserted the data).
If your data is just being inserted into the server, then you can probably use the SQL functions GetUTCDate and compare it to GetDate and then subtract the result from your datetime stored in the database. Then, on the client, use DateTime.ToLocalTime () to convert the return value to local time. As I said, this will only work if the data is exclusively inserted into the server, or at least by clients in the same timezone. Otherwise, forget about it.
source to share