We discovered that our scheduled job for handling expired offers was running one hour late in our cloud environment.
For example, an offer with an expiry date of 18:15 should be marked as expired after 100 seconds and trigger a notification. However, every time the system marks the offer as expired, it does so at 19:15, one hour later than expected.
This immediately raised a red flag—a timezone mismatch is a common issue in distributed systems.
Since timezone-related issues are common in multi-environment applications, the first step was to verify the database's timezone setting.
We ran the following PostgreSQL command:
SHOW TIMEZONE;
Output: UTC
This means that our database operates in Coordinated Universal Time (UTC).
We queried an example offer to inspect how its expiry date was stored.
25-03-04 18:14:00
This confirms that the expiry date is exactly as provided by the frontend.
Next, we checked how this field was defined in our entity class.