diff --git a/CHANGELOG.md b/CHANGELOG.md index 396c45f12..6edd95210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,19 @@ All notable changes to this library are documented in this file. +## Unreleased Version + +### API Changes + +### New Features + +### Bug Fixes + +- Correct decoding of 12 UTC timestamp in MND header. + ## **1.13.0** (24 Jun 2022) + ### API Changes - Added `sqlalchemy` as a hard package requirement. diff --git a/data/product_examples/TPTLAT.txt b/data/product_examples/TPTLAT.txt new file mode 100644 index 000000000..a356f57c6 --- /dev/null +++ b/data/product_examples/TPTLAT.txt @@ -0,0 +1,44 @@ +949 +ABXX07 KWBC 271200 +TPTLAT + +LATIN AMERICAN TEMP AND WEATHER TABLE +NWS TELECOMMUNICATION OPERATIONS CENTER SILVER SPRING MD +1200 UTC MON JUN 27 2022 + + PRESENT LOCAL TEMPS +CITY WEATHER TIME F C + +ANTIGUA FAIR 8AM 82 28 +ASUNCION 8AM 61 16 +BELIZE CITY FAIR 6AM 79 26 +BOGOTA FOG 7AM 50 10 +BRIDGETOWN FAIR 8AM 82 28 +BUENOS AIRES FAIR 9AM 48 9 +CARACAS PTCLDY 8AM 81 27 +CAYENNE CLDY 9AM 77 25 +GEORGETOWN HAZE 8AM 79 26 +GUATEMALA CITY CLDY 6AM 63 17 +HAVANA CLDY 7AM 73 23 +KINGSTON FAIR 7AM 81 27 +LA PAZ 8AM 37 3 +LIMA MIST 7AM 59 15 +MANAGUA FAIR 6AM 75 24 +MEXICO CITY CLDY 6AM 59 15 +MONTEVIDEO CLDY 9AM 48 9 +PANAMA CITY PTCLDY 6AM 77 25 +PARAMARIBO PTCLDY 8AM 75 24 +PORT AU PRINCE FAIR 8AM 81 27 +PORT OF SPAIN RAIN 8AM 82 28 +QUITO 7AM NO DATA +RIO DE JANEIRO CLDY 9AM 64 18 +SAINT THOMAS PTCLDY 8AM 82 28 +SAN JOSE FAIR 6AM 66 19 +SAN JUAN PTCLDY 8AM 81 27 +SAN SALVADOR 6AM NO DATA +SANTIAGO MISTY 8AM 32 0 +SANTO DOMINGO FAIR 7AM 79 26 +SAO PAULO CLDY 9AM 57 14 +TEGUCIGALPA CLDY 6AM 63 17 + +$$ diff --git a/src/pyiem/nws/product.py b/src/pyiem/nws/product.py index 9f8da98b8..85e6ce71d 100644 --- a/src/pyiem/nws/product.py +++ b/src/pyiem/nws/product.py @@ -164,7 +164,7 @@ def date_tokens2datetime(tokens): hh = hhmi[:-2] mi = hhmi[-2:] # Workaround 24 hour clock abuse - if int(hh) > 12 and ( + if int(hh) >= 12 and ( tokens[1].upper() == "PM" or tokens[2] in ["UTC", "GMT"] ): # this is a hack to ensure this is PM when we are in UTC diff --git a/tests/nws/test_product.py b/tests/nws/test_product.py index 0c31d70f2..6a72c1396 100644 --- a/tests/nws/test_product.py +++ b/tests/nws/test_product.py @@ -14,6 +14,12 @@ from pyiem.util import utc, get_test_file +def test_220627_timestamp(): + """Test that the right timestamp is parsed.""" + prod = productparser(get_test_file("TPTLAT.txt")) + assert prod.valid == utc(2022, 6, 27, 12) + + def test_frwoun_jabber(): """Test that we get a special twitter media out of this.""" prod = productparser(get_test_file("FRW/FRWOUN.txt"))