API

Sections

Theme switcher

Timezones

Correctly interpreting timestamps is essential when using our API. This section outlines how timezones are applied across different fields.

Station-Specific Times

For fields related to specific station events, such as departure_start and departure_end, the timezone is always the local time of that particular station.

This applies even if a trip spans multiple timezones. Consider a trip from Lisbon (PTLISLBS) to Milan (ITMILMVI):

JSON
{ "attributes": { "arrival_time": "2025-05-29T05:15", "booked_out": false, "cheapest_fare_class_code": "FARE-1", "cheapest_total_adult_price": 13646, "departure_time": "2025-05-27T09:35", "duration": 153600, "electronic_ticket_available": false, "leg_type": "outbound", "offer_bundle": null, "offer_id": null, "total_seats_left": 23 }, "id": "FLIU-PTLISLBS-ITMILMVI-2025-05-27T09:35-2025-05-29T05:15", "relationships": { "arrival_station": { "data": { "id": "ITMILMVI", "type": "stations" } }, "departure_station": { "data": { "id": "PTLISLBS", "type": "stations" } }, "fares": { "data": [ { "fare_class": { "code": "FARE-1", "id": "FLIU-FARE-1", "type": "fare_classes" }, "id": "FLIU-PTLISLBS-ITMILMVI-2025-05-27T09:35-2025-05-29T05:15-FARE-1", "original_price": 13646, "price": 13646, "type": "fares" } ] }, "marketing_carrier": { "data": { "id": "FLIU", "type": "marketing_carriers" } }, "segments": { "data": [ { "id": "FLIU-PTLISLBS-ITGENGVF-2025-05-27T09:35-2025-05-28T16:05-0", "type": "segments" }, { "id": "FLIU-ITGENGVF-ITSIIFVC-2025-05-28T18:20-2025-05-28T21:00-1", "type": "segments" }, { "id": "FLIU-ITSIIFVC-ITMILMVI-2025-05-29T01:50-2025-05-29T05:15-2", "type": "segments" } ] } }, "type": "connections" }

Here's how to interpret it:

  • departure_time: "2025-05-27T09:35" is the local time in Lisbon when the trip begins.
  • arrival_time: "2025-05-29T05:15" is the local time in Milan when the trip ends.
  • duration: 153600 seconds (which is 42 hours and 40 minutes) is the actual, total travel time. This duration accurately bridges the local departure time in Lisbon and the local arrival time in Milan, automatically accounting for the one-hour timezone difference between them (as Milan is ahead of Lisbon).

Essentially, departure_time and arrival_time tell you what the clock at the station shows. The duration confirms the true length of the journey.

General System Times

For non-station-specific timestamps, such as those related to reservation lifecycle or processing, the timezone is consistently Germany's local time. This means the times will be in either Central European Time (CET) or Central European Summer Time (CEST), automatically accounting for daylight saving changes.

For example, in a response from the /reservations/create endpoint:

JSON
{ "data": { "id": "RRYZCKBP", "type": "reservations", "attributes": { "total_price": 2485, "original_price": 2485, "state": "created", "created_at": "2025-05-20T16:08", "confirmed_at": null, "cancelled_at": null, "failed_at": null, "processing_started_at": null, "processing_deadline": null, "expires_at": "2025-05-20T16:38", ...
  • created_at: "2025-05-20T16:08" means the reservation was created on May 20th, 2025, at 16:08 CEST (Central European Summer Time, UTC+2), as May falls within the daylight saving period for Germany.
  • expires_at: "2025-05-20T16:38" means the reservation will expire at 16:38 CEST on the same day.

Always interpret these general system timestamps as being in the current local time for Germany.

Was this section helpful?

What made this section unhelpful for you?

On this page
  • Timezones
View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot