Base solution for your next web application
Open Closed

ClockProvider.UTC changes DateTime parameters from URI to DateTimeKind.Local #7087


User avatar
1
Synciant created

I am using project type Angular+ASP.NET Core v6.5 . I am creating an app which is used in multiple timezones.

I have set Clock.Provider = ClockProviders.Utc in Startup.cs under ConfigureServices(IServiceCollection services)

Whenever, I pass a Date in the URI from the client, it gets converted to DateTimeKind.Local on the server side. But when I pass it through body it remains DateTimeKind.Utc. I want it to remain in DateTimeKind.Utc for both medium.

What am I doing wrong? How can I fix it?


1 Answer(s)