Payments are experiencing issues due to temporary restrictions in Russia. If your payment does not go through, please submit a support request.Our support team is available 24/7 — we are always here to help with hosting and server issues.We are now accepting requests for dedicated server rental and colocation services in our data center.Reminder: we recommend enabling backups for additional data protection.A new VPS/VDS lineup with NVMe storage and improved performance is now available.Maintenance work on some servers has been completed. All services are operating normally.
Article5 min readViews0

Order Placed Yesterday: How to Align Dates in the Store API and Reports

A single moment can have different calendar dates in Moscow and UTC. Using a verified example, we examine day boundaries, fractional seconds, and the distinction between delivery date and event time.

Comments 0

A single yellow glass sphere at the boundary between dark and light surfaces: one moment between two dates
In this article

An order was placed on September 27 at 00:30 Moscow time. In the export, the date starts on September 26, yet the manager searches for it in the report for the 27th. The order is not necessarily lost, and the server clock is not necessarily behind. A single moment in time can correspond to different calendar dates in different time zones.

Before hunting for an error, agree on two things: which event the report counts and in which time zone its day boundaries lie. Creation date, payment date, and notification receipt date answer different questions. Even perfectly set clocks will not make these events the same.

One moment, two records

Consider a test event: 2026-09-27T00:30:00+03:00. The record shows local time and a three-hour offset ahead of UTC. The same moment in UTC is recorded as 2026-09-26T21:30:00Z. The letter Z denotes zero offset. With correct conversion, the event remains in place; only its representation changes.

The RFC 3339 format allows unambiguous transmission of date, time, and offset within its defined model. A string without an offset requires additional contractual conditions. If one party interprets it as Moscow time and the other as UTC, a genuine three-hour error arises. Fixing it by adding hours to all records is dangerous: some data may have arrived correctly.

For investigation, I would match a single order ID, the original time string, the parsing rule, and the value after conversion. A screenshot with a single date does not show this entire chain. It is also useful to clarify whether the time was rounded or if part of it was dropped during export.

How to define a day without the final second

For the report dated September 27, 2026, for Moscow, the lower bound is the start of September 27, and the upper bound is the start of September 28. We include the lower bound and exclude the upper bound. After conversion to UTC, this interval is from 2026-09-26T21:00:00Z inclusive to 2026-09-27T21:00:00Z exclusive. These conversions were independently verified in a local Python model with a time zone database.

This rule is more convenient than using 23:59:59 as the upper bound. An event with fractional seconds after 23:59:59 still belongs to the same calendar day but may fail a comparison against the whole final second. The condition "before the start of the next day" covers the available time precision without guessing the number of nines.

The adjacent report starts exactly where the previous one ended. An event on the boundary falls into the next interval only once. If both bounds are included in both reports, midnight may be counted twice. If both are excluded, the event disappears from both. Here, the comparison operator matters, not just a neatly labeled calendar.

Offset and time zone solve different problems

A +03:00 offset is sufficient to determine the moment from the given record. However, for the rule "every day in local time," it is useful to store a named time zone, such as Europe/Moscow. This is linked to IANA database rules, including historical changes. A single fixed offset does not describe all possible regional rules for any given date.

In regions with seasonal clock changes, calendar days can differ in duration from 24 hours. Therefore, for a report, one must first determine the local start times of two consecutive dates, then convert both boundaries to a single time scale. Simply adding 24 hours to the already converted lower boundary does not work for every region or day.

The environment must have up-to-date time zone data. For example, the Python module uses the system database or a separate data package; the absence of a database or different versions constitute separate reproducibility conditions. This is not an instruction to change the clock on a production server. Calculating the reporting period and synchronizing clocks are distinct checks.

Delivery date may not be a specific moment

A buyer's request to "deliver on September 27" may refer to the calendar date according to store rules. Converting it without an agreement to midnight UTC and then displaying it as local time adds meaning the buyer did not specify. Such a field requires a date type and an explicit rule for its application.

Conversely, the fact of payment requires the timestamp of the specific event if the report depends on it. Receiving a notification ten minutes later does not change the payment moment in the source. With a delayed notification, the system must, per the contract, either recalculate the relevant period or reflect a correction. Moving the event to today's date solely because the handler saw it today is permissible only under such a definition of the metric.

During acceptance testing, it is useful to check the event immediately before midnight, exactly at midnight, and immediately after; separately, also check a fractional second before the upper boundary. Then repeat the transmission of the same event with a different correct offset. The report must preserve the result if both records denote the same moment.

For a store on 1C-Bitrix and an external accounting system, this is a matter of the general exchange contract, not the choice of a single magical format. Verify the event type, source time, time zone of the period, and rules for late data. After that, the phrase "the order fell into yesterday" becomes a verifiable statement: either the day was selected incorrectly, the time was parsed incorrectly, or different events are being compared.

Discussion 0

Share your experience and ask questions. Comments without links appear after editorial review.

No comments yet. Start the discussion.