diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-02 17:04:25 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-04-02 17:04:25 +0200 |
commit | f40128dedfd431e91960e1271f1a677369941058 (patch) | |
tree | 4014d4f069e836349d751f9702b36f0de7322945 /lib/Travel/Routing/DE/HAFAS/Connection.pm | |
parent | e6480f632d07b30f4f3ee538731f157c922a16b2 (diff) |
Convert non-local timestamps to local time zone
Diffstat (limited to 'lib/Travel/Routing/DE/HAFAS/Connection.pm')
-rw-r--r-- | lib/Travel/Routing/DE/HAFAS/Connection.pm | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS/Connection.pm b/lib/Travel/Routing/DE/HAFAS/Connection.pm index 5ccf498..05341cc 100644 --- a/lib/Travel/Routing/DE/HAFAS/Connection.pm +++ b/lib/Travel/Routing/DE/HAFAS/Connection.pm @@ -62,20 +62,30 @@ sub new { ); # dProgType/aProgType: CORRECTED oder PROGNOSED - my $sched_dep = $connection->{dep}{dTimeS}; - my $rt_dep = $connection->{dep}{dTimeR}; - my $sched_arr = $connection->{arr}{aTimeS}; - my $rt_arr = $connection->{arr}{aTimeR}; - - for my $ts ( $sched_dep, $rt_dep, $sched_arr, $rt_arr ) { - if ($ts) { - $ts = handle_day_change( - date => $date, - time => $ts, - strp_obj => $strptime, - ); - } - } + my $sched_dep = handle_day_change( + date => $date, + time => $connection->{dep}{dTimeS}, + offset => $connection->{dep}{dTZOffset}, + strp_obj => $strptime, + ); + my $rt_dep = handle_day_change( + date => $date, + time => $connection->{dep}{dTimeR}, + offset => $connection->{dep}{dTZOffset}, + strp_obj => $strptime, + ); + my $sched_arr = handle_day_change( + date => $date, + time => $connection->{arr}{aTimeS}, + offset => $connection->{arr}{aTZOffset}, + strp_obj => $strptime, + ); + my $rt_arr = handle_day_change( + date => $date, + time => $connection->{arr}{aTimeR}, + offset => $connection->{arr}{aTZOffset}, + strp_obj => $strptime, + ); my @sections; for my $sec (@secL) { |