Troubleshooting Case: Offer Expiration Running One Hour Late

The Problem

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.


Initial Investigation: Database Timezone

Since timezone-related issues are common in multi-environment applications, the first step was to verify the database's timezone setting.

Checking the Database Timezone

We ran the following PostgreSQL command:


SHOW TIMEZONE;

Output: UTC

This means that our database operates in Coordinated Universal Time (UTC).


Examining the Expiry Date in the Database

We queried an example offer to inspect how its expiry date was stored.

Database Expiry Date Example:

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.