[英]ASP.NET Core DateTime Rest API with Javascript converts to UTC instead of java
I have a problem with sending data from my react application with data Sat Oct 30 2021 00:00:00 GMT+0800 (Singapore Standard Time)
from javascript function new Date()
.我在从我的 react 应用程序发送数据时遇到问题,数据为
Sat Oct 30 2021 00:00:00 GMT+0800 (Singapore Standard Time)
来自 javascript 函数new Date()
。 When receiving from the my ASP.NET Core Rest Web API application, it converted to {10/29/2021 4:00:00 PM}
for reason.当从我的 ASP.NET Core Rest Web API 应用程序接收时,它
{10/29/2021 4:00:00 PM}
原因转换为{10/29/2021 4:00:00 PM}
。 I think what received from ASP.NET was a UTC
time conversion from the javascript DateTime
that send from my react application.我认为从 ASP.NET 收到的是来自我的反应应用程序发送的 javascript
DateTime
的UTC
时间转换。 Is there a way to not convert the and retain the same data as javascript DateTime
when it receives data from my ASP.NET Core application?有没有办法在从我的 ASP.NET Core 应用程序接收数据时不转换并保留与 javascript
DateTime
相同的数据?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.