A
A
Andrey2021-03-20 12:12:58
Amazon Web Services
Andrey, 2021-03-20 12:12:58

Why is the time lost in node.js new Date()?

Telegram bot is written on node.js, this bot works on Amazon lightsail. When certain events occur, the date is taken into account with time using new Date () without any adjustments in time zones and is entered into the MondoDb database through the mongoose library. Sometimes, for unknown reasons, time gets lost and a date can be set, for example yesterday, or maybe a week. What can affect the date setting? In the metric, the server load does not exceed 2 percent, there are no server errors.
It’s just that when I myself test and often execute these events, everything is set correctly for me. The date rarely goes astray, it happens once a week, it happens 2 times a week. Server time in time zone -3 hours.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question