From 152907734c1ba64d39aeed6e7484031ba6794e35 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Tue, 13 Aug 2024 21:09:23 +0200 Subject: carriage formation: show timestamp of (possibly cached) result --- lib/DBInfoscreen/Helper/Wagonorder.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/DBInfoscreen/Helper') diff --git a/lib/DBInfoscreen/Helper/Wagonorder.pm b/lib/DBInfoscreen/Helper/Wagonorder.pm index 94eebb1..c736816 100644 --- a/lib/DBInfoscreen/Helper/Wagonorder.pm +++ b/lib/DBInfoscreen/Helper/Wagonorder.pm @@ -8,6 +8,7 @@ use strict; use warnings; use 5.020; +use DateTime; use Mojo::Promise; sub new { @@ -93,6 +94,8 @@ sub get_p { $self->{log}->debug("wagonorder->get_p($url): OK"); my $json = $tx->res->json; + $json->{ts} = DateTime->now( time_zone => 'Europe/Berlin' ) + ->strftime('%d.%m.%Y %H:%M'); $self->{main_cache}->freeze( $url, $json ); $promise->resolve( $json, \%param ); -- cgit v1.2.3