From 7772131ad274692d7fb71bd8f69241df661835e8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 16 Jul 2023 01:25:29 -0400 Subject: fix weather time zone --- bin/hornet/weather | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/hornet/weather b/bin/hornet/weather index c47301c..1cbbffb 100755 --- a/bin/hornet/weather +++ b/bin/hornet/weather @@ -19,8 +19,10 @@ if (length($location) == 5) { $location = zip_location($location); } (my $lat, my $lon) = split ',', $location; +my $tz = readlink("/etc/localtime"); +$tz =~ s{^/usr/share/zoneinfo/}{}; -my $data = slurp_http("https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon¤t_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability"); +my $data = slurp_http("https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon&timezone=$tz¤t_weather=true&hourly=temperature_2m,apparent_temperature,precipitation_probability"); my $time = $data->{current_weather}{time}; my $hourly = $data->{hourly}; my @forecast; -- cgit v1.2.3-54-g00ecf