From the image shown, there is no error. Part of DateTime
is the time zone, which in Brazil is always GMT-3 (since there is no longer daylight saving time). The time shown in Angular indicates that it is in GMT. There are several ways to treat the time zone on the front end, the easiest one should be with the use of libraries like the Moment.js.
Looking at the backend image, the time will have the "normal" component of time and also the time zone. The ideal is to always work with UTC, avoiding this kind of problem and convert the time only in the presentation layer, taking into account the user’s time zone.
Side note: UTC and GMT is not the same thing "philosophically" speaking, but in the background will have the same result. So the "GMT" you’re seeing at Angular would be equivalent to UTC at DateTime.UtcNow
no. Net.
Probably the problem is that the browser and its server are in different timezones
– Eduardo Vargas
Yes, how do I set up . net core p/ do not add up +3 hours globally? To always pick the time provided.
– Alessandro
I honestly do not understand why some users vote negative for the question, what is the problem with the question? Instead of just judging...
– Alessandro
I was able to add one more parameter in the conversion: link.data_link = new Date(this.datePipe.Transform(data_link, "yyyy-MM-dd HH:mm:ss", "GMT-6")), is that correct? Should I proceed this way for all the dates I will forward? This does not seem consistent to me...
– Alessandro