summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS/Journey.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-02 16:15:34 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-02 16:15:34 +0200
commitb1a17e8d1776ddaf3bcfa3a4d371ac47533d01ac (patch)
tree3fad84690ee02676835a481f5a1c5e9e40bd250c /lib/Travel/Status/DE/HAFAS/Journey.pm
parentfb76c6eb57c20177eca19d6fe03a573f378654f8 (diff)
Journey, Stop: Use the service's time zone for all datetimes; mark adjustments
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS/Journey.pm')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm
index 223dc13..ed66cdd 100644
--- a/lib/Travel/Status/DE/HAFAS/Journey.pm
+++ b/lib/Travel/Status/DE/HAFAS/Journey.pm
@@ -14,7 +14,7 @@ use Travel::Status::DE::HAFAS::Stop;
our $VERSION = '5.06';
Travel::Status::DE::HAFAS::Journey->mk_ro_accessors(
- qw(datetime sched_datetime rt_datetime
+ qw(datetime sched_datetime rt_datetime tz_offset
is_additional is_cancelled is_partially_cancelled
station station_eva platform sched_platform rt_platform operator
product
@@ -185,6 +185,7 @@ sub new {
}
$timestr = Travel::Status::DE::HAFAS::Stop::handle_day_change(
+ $journey,
input => $timestr,
date => $date,
strp_obj => $hafas->{strptime_obj},
@@ -473,6 +474,13 @@ DateTime object indicating the arrival/departure date and time.
Real-time data if available, schedule data otherwise.
undef if neither is available.
+=item $journey->tz_offset
+
+Offset between the backend's time zone (default: Europe/Berlin) and this
+journey's time zone in minutes, if any. For instance, if the backend is
+currently in UTC+2 (CEST) and the journey is in UTC+1 (IST), tz_offset is -60.
+undef if both are in the same time zone (or rather, the same UTC offset).
+
=item $journey->delay (station only)
Delay in minutes, or undef if it is unknown.