Handling Timezones in Order Creation and Retrieval via APIs

Modified on Tue, 11 Mar at 1:07 PM


When working with ReadyAt, PickupWindow, and DeliveryWindow (or DropoffWindow), the time offsets specified are not converted to the Tenant's time offset. Instead, they are stored exactly as received.

When retrieving an order, the time offsets for pickup and delivery windows are returned in the offset they were originally created. However, if they were entered as +00:00, they will be returned in the Tenant's time offset.


Timezone Support in Order Creation

Order creation now supports the timezones of pickup and delivery locations. This enables better accuracy when defining order timing based on local time zones.


Using Pickup Location Timezone

To let Dispatch Science set the time zone according to the Pickup address replace:

"ReadyAt": "YYYY-MM-DDThh:mm:ss+00:00"

with:

"PickupLocalReadyAt": "YYYY-MM-DDThh:mm:ss"

To let Dispatch Science set the time zone according to the Pickup address replace:

"PickupWindow": {
  "start": "YYYY-MM-DDThh:mm:ss+00:00",
  "end": "YYYY-MM-DDThh:mm:ss+00:00"
}

with:

"PickupLocalWindow": {
  "start": "YYYY-MM-DDThh:mm:ss",
  "end": "YYYY-MM-DDThh:mm:ss"
}

Using Delivery Location Timezone

To let Dispatch Science set the time zone according to the Delivery address replace:

"DeliveryWindow": {
  "start": "YYYY-MM-DDThh:mm:ss+00:00",
  "end": "YYYY-MM-DDThh:mm:ss+00:00"
}

with:

"DeliveryLocalWindow": {
  "start": "YYYY-MM-DDThh:mm:ss",
  "end": "YYYY-MM-DDThh:mm:ss"
}

Alternatively, if using DropoffWindow:

"DropoffWindow": {
  "start": "YYYY-MM-DDThh:mm:ss+00:00",
  "end": "YYYY-MM-DDThh:mm:ss+00:00"
}

should be replaced with:

"DropoffLocalWindow": {
  "start": "YYYY-MM-DDThh:mm:ss",
  "end": "YYYY-MM-DDThh:mm:ss"
}

Timezone Information in Order Retrieval

When retrieving orders, additional information about pickup and delivery timezones is provided. The offset is displayed in minutes.

Example:

"pickupTimeZone": {
  "systemTimeZoneId": "Atlantic Standard Time",
  "ianaTimeZoneId": "America/Halifax",
  "longDisplayName": "Atlantic Daylight Time",
  "shortDisplayName": "ADT",
  "isDaylightSavingTime": true,
  "offset": -180
}

"dropoffTimeZone": {
  "systemTimeZoneId": "Eastern Standard Time",
  "ianaTimeZoneId": "America/New_York",
  "longDisplayName": "Eastern Daylight Time",
  "shortDisplayName": "EDT",
  "isDaylightSavingTime": true,
  "offset": -240
}

Summary

  • Time offsets are stored as received, not converted to the Tenant time offset.

  • Timezones of pickup and delivery locations are now supported in order creation.

  • **Use PickupLocalReadyAt, PickupLocalWindow, and **DeliveryLocalWindow for more accurate time calculations.

  • Retrieving orders includes timezone details, with offsets displayed in minutes


This ensures accurate handling of time-sensitive order data across different time zones.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article