Last post Nov 12, 2020 06:08 AM by yij sun
Nov 11, 2020 02:02 PM|krisrajz|LINK
My SPA application is based out of Knockout as front end and ASP.Net Web API with EF as backend. Seems everything works fine until if someone changes submits date from India region. Though front end is correctly sending data to the web service, it seems
on the server side previous day is taken only if users are submitting any dates from India region. This is not an issue with any other region like US Central. There is no explicit conversion method used. I am scratching head and wondering who/what is going
on here. The field in question is declared as DateTime field. Any help would be much appreciated.
Nov 12, 2020 06:08 AM|yij sun|LINK
As far as I think,you try to trust the client passing dates to the server as little as possible. For example, if you need "now", don't create a date on the client and then pass it to the server.
Either create a date in your GET and pass it or on POST do DateTime.UtcNow.
Or,you could pass dates and timezone to the server.
More details,you could refer to below article: