ASP.net WebService Date Parameter Time Zone Offset

I have an asp.net webservice with a parameter of type datetime. I noticed that asp.net seems to be offsetting a date based on the clients time zone.

I need to disable this functionality. I just want to pass the date (t. 3/15/2009) to the webservice from javascript without any timezone context.

Is my only way to change the type of a parameter to a string, then convert it to a server, or is there a way to disconnect the deserializer from shifting my date parameter?

+3
source share
3 answers

I would use a string.

- DateTime " ", , DateTime, INSTANT. , : " 5 ", .

+1

"", , , , , , , . . ( ), . - . . , , , , (EG 04/01/2009 01:00 - 04/01/2009 00:00).

I was thinking about just parting the time. It seemed OK until I considered a request coming from a time zone east of east (which will happen because we have clients in Thailand). I was upset because the final date will be one day before the date sent in the request. Then I realized that it was the date that I want to use.

I hope your script will work just like mine.

0
source

Source: https://habr.com/ru/post/1704802/


All Articles