Skip to content

Tracking API - incorrect way to return timestamps #187

@vitalyvasilenko

Description

@vitalyvasilenko

Hello,

Currently the Tracking API returns timestamps in separate fields for date and time.
There are shipment, package and activity level timestamps.

Shipment level timestamps:

$.trackResponse.shipment.pickupDate - a date in unknown local time zone ("20250825")

Package level timestamps:

$.trackResponse.shipment.package.deliveryDate.date - a date in unknown local time zone ("20250826")
$.trackResponse.shipment.package.deliveryTime.startTime - a time in unknown local time zone ("163703")
$.trackResponse.shipment.package.deliveryTime.endTime - a time in unknown local time zone ("163703")

Activity level timestamps:

$.trackResponse.shipment.package.activity.date - a date in the activity local time zone ("20250826")
$.trackResponse.shipment.package.activity.time - a time in the activity local time zone ("084434")
$.trackResponse.shipment.package.activity.gmtDate - a date in UTC ("20250826")
$.trackResponse.shipment.package.activity.gmtTime - a time in UTC ("15:44:34")
$.trackResponse.shipment.package.activity.gmtOffset - the activity local time zone offset ("-07:00")

Modern systems never use similar approaches and always return timestamps in UTC or "UTC+offset" for many reasons. Also there is not a way to convert shipment and package level timestamps to UTC or any other time zone as we don't know corresponding locations (and therefore their time zone offsets). All timestamps should be returned in the following standard form:

2025-09-06T00:00:00+00:00
where
2025-09-06 - UTC date
00:00:00 - UTC time
+00:00 - local time zone offset if it's applicable

If a timestamp represents a date its time component is "00:00:00" and its time zone offset component matches the corresponding location time zone offset if the date is a local date. Fields mentioned above can be replaced or enhanced (for backward compatibility) with the following fields:

$.trackResponse.shipment.pickupTimestamp - for example, 2025-09-06T00:00:00-07:00

$.trackResponse.shipment.package.deliveryTimestamp.startTime - for example, 2025-09-06T13:00:00-07:00
$.trackResponse.shipment.package.deliveryTimestamp.endTime - for example, 2025-09-06T16:00:00-07:00

$.trackResponse.shipment.package.activity.timestamp - for example, 2025-09-06T16:15:04-07:00

This approach requires fewer fields and they provide more info. Currently shipment and package level timestamps is useless as we cannot compare them to other timestamps and figure out if one event has occurred before or after than another.

Please fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions