Author Topic: Time showing as 12:00am when it is NOON  (Read 277 times)

0 Members and 1 Guest are viewing this topic.

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3192
    • Carson Valley Weather
Time showing as 12:00am when it is NOON
« on: August 29, 2017, 08:24:18 PM »
I just noticed that our high today occurred at exactly 12 Noon. However, the template shows it as being 12:00am (see uploaded screen image). That makes me wonder what time is indicated when it is exactly 12 Midnight?

Ken - It's no biggee but after so many years of being in use, I've never seen that phenomenon reported by anyone on the forum.

EDIT: Here's link to NIST with their definition and suggested way to handle noon and midnight...

« Last Edit: August 29, 2017, 08:34:52 PM by W3DRM »
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37S-b53,
StartWatch, VirtualVP, VPLive, , Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6187
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time showing as 12:00am when it is NOON
« Reply #1 on: August 29, 2017, 09:48:23 PM »
Hi Don,
Those times come from WD via testtags.php as
Code: [Select]
$maxtemp =  '94.6°F'; // today's maximum temperature
$maxtempt =  '2:07 PM'; // time this occurred
$mintemp =  '57.6°F'; // today's minimum temperature
$mintempt =  '6:10 AM'; // time this occurred
and are updated from clientraw.txt via ajaxWDwx.js script.

You didn't indicate if this snapshot was just the PHP or this was after the AJAX update happened -- makes a difference on where to focus the debugging effort.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3192
    • Carson Valley Weather
Re: Time showing as 12:00am when it is NOON
« Reply #2 on: August 30, 2017, 12:32:34 AM »
It must have been after the AJAX update occurred as it was displayed there for several hours. Just something curious and most likely will never see it again.
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37S-b53,
StartWatch, VirtualVP, VPLive, , Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3192
    • Carson Valley Weather
Re: Time showing as 12:00am when it is NOON
« Reply #3 on: August 30, 2017, 11:05:58 AM »
Had the same problem this morning. I am attaching both the clientraw.txt and the testtags.php files to this post for you to see. Both of them show the time as 12:00 AM.

Interestingly, the high at the time occurred at 12 Midnight and not 12 Noon as I saw yesterday so the software is handling both midnight and noon exactly the same and showing both as 12:00 AM. That is definitely not what we want to see displayed.


I also added the screen capture from this morning for a visual confirmation of what I am seeing.
« Last Edit: August 30, 2017, 11:17:36 AM by W3DRM »
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37S-b53,
StartWatch, VirtualVP, VPLive, , Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6187
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time showing as 12:00am when it is NOON
« Reply #4 on: August 31, 2017, 11:06:20 AM »
Oddly, that looks correct.  the daily min/max resets at midnight, and the current temperature is less than that maximum.

Testtags.php has
Code: [Select]
$maxtemp =  '64.3°F'; // today's maximum temperature
$maxtempt =  '12:00 AM'; // time this occurred
$mintemp =  '53.6°F'; // today's minimum temperature
$mintempt =  '5:37 AM'; // time this occurred

and
Code: [Select]
$temperature =  '56.1°F'; // temperature
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3192
    • Carson Valley Weather
Re: Time showing as 12:00am when it is NOON
« Reply #5 on: August 31, 2017, 01:42:09 PM »
Hi Ken,

I'm not questioning the temperature values. Only that the code seems to designate 12 midnight and 12 noon as being "12:00 AM". The usage of 12:00 AM is ambiguous and does not clearly articulate the time as being either 12 midnight or 12 noon.

In the link for the NIST article I posted earlier in this thread it clearly states the following:

"Are noon and midnight referred to as 12 a.m. or 12 p.m.? This is a tricky question because 12 a.m. and 12 p.m. are ambiguous and should not be used."

Thus, I believe there is a code issue with how WD and/or the Saratoga template displays values for 12 noon and 12 midnight. In addition to that, it appears that the code always uses 12:00 AM as the displayed value for both NOON and MIDNIGHT time values. This is based on what I am seeing in my above posted screen snapshots.
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37S-b53,
StartWatch, VirtualVP, VPLive, , Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6187
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time showing as 12:00am when it is NOON
« Reply #6 on: August 31, 2017, 03:22:47 PM »
Hi Don,

No dispute about the ambiguity of 12am/12pm.  The source of the time is Weather-Display -- the template just displays the value.  You can switch to 24hr time for the tags/clientraw if you like, and that would be unambiguous.

Brian would be the one to address the 'AM'/'PM' issue with Weather-display.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP