From 36600b39e1256b9fc0e0f7b6b6ecb225102f2768 Mon Sep 17 00:00:00 2001 From: akrherz Date: Thu, 9 Jan 2025 13:26:08 -0600 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Use=20local=20timezone=20date=20for?= =?UTF-8?q?=20SCP=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #1062 --- htdocs/sites/scp.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/htdocs/sites/scp.php b/htdocs/sites/scp.php index e21256edaf..9b992ee898 100644 --- a/htdocs/sites/scp.php +++ b/htdocs/sites/scp.php @@ -36,13 +36,15 @@ $exturi = sprintf( "https://mesonet.agron.iastate.edu/" . - "api/1/scp.json?station=%s&date=%s", + "api/1/scp.json?station=%s&date=%s&tz=%s", $station, - date("Y-m-d", $date) + date("Y-m-d", $date), + $metadata["tzname"], ); $arr = array( "station" => $station, "date" => date("Y-m-d", $date), + "tz" => $metadata["tzname"], ); $json = iemws_json("scp.json", $arr); if ($json === FALSE) { @@ -88,8 +90,11 @@ function skyc($row, $i) $table = << - -SCP Valid UTC$headerASOS METAR Report + + +SCP Valid UTC +METAR Valid Local +$headerASOS METAR Report $header2Levels ftMETAR @@ -103,8 +108,9 @@ function skyc($row, $i) continue; } $table .= sprintf( - "%sZ", - gmdate("Hi", strtotime($row["utc_scp_valid"])) + "%sZ%s", + gmdate("Hi", strtotime($row["utc_scp_valid"])), + date("g:i A", strtotime($row["local_valid"])) ); foreach ($birds as $b) { $table .= sprintf(