Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4878

Troubleshooting • 'date' returns incorrect date/time?

$
0
0
I've been running a Pi 2 Model B Rev 1.1/Buster to log some USB scales and other sensors, with a time stamp. Lately it's starting logging bogus dates. Relevant code that gets run by cron every 10 minutes:

*/10 * * * * /usr/local/bin/LogWeightTempHum.sh /home/pi/out.txt

where LogWeightTempHum.sh contains:

Code:

TheDateTime=`date +%F"-"%T`<reading the scales and temper/humidity sensors, and openweather.org>sudo echo $TheDateTime $TheWeight1 $TheWeight2 $TheWeight3 $TheWeight4 $TheWeather $TheTemperHum >> $OutFile
It's been reliable for the past several years, and then a few weeks ago it started doing this:
2024-06-29-09:40:02 273.6 137 244.2 72.28 70 84.11 58
2024-06-29-12:30:01 274.5 136.6 243.4 71.91 71 84.04 58
2024-06-29-12:40:01 274.6 136.7 243.3 73.08 70 84.34 58
2024-06-29-12:20:01 275.1 136.8 243.1 72.93 70 84.65 57
2024-06-29-13:00:01 275.4 136.9 243.3 73.38 72 85.03 57
2024-06-29-13:10:01 275.3 136.7 243.1 73.38 72 85.19 57
2024-06-29-13:20:02 276.5 136.5 242.5 73.89 65 85.35 57
2024-06-29-13:30:01 276.5 136.1 242.3 73.26 67 85.59 57
2024-06-29-13:40:02 276 136.3 242.2 73.58 67 85.73 57
2024-06-29-13:50:01 276.1 136.2 241.6 73.13 68 86.04 57
2024-06-29-12:50:01 275.9 136.8 241.8 73.13 68 86.58 57
2024-06-29-14:10:01 276.5 136.6 241.2 73.65 67 86.74 57
2024-06-29-14:00:02 276.7 136.3 241.5 73.67 67 86.97 57
2024-06-29-14:30:01 276.7 136.2 241.1 73.6 67 86.97 57
2024-06-29-14:40:01 276.7 136.3 241.2 73.47 68 86.97 56
2024-06-29-14:50:01 276.3 136.7 241.2 73.36 69 87.51 56
2024-06-29-15:00:01 276.5 136.4 241 74.12 67 87.66 56
2024-06-29-15:10:02 276.9 135.8 240.7 74.01 69 88.20 56
2024-06-29-15:20:01 275.3 132.8 240.4 74.43 65 89.20 57
2024-06-29-14:20:01 273.7 129.7 239.1 74.08 66 91.29 57
2024-06-29-15:40:02 272.7 128.7 238.2 73.09 66 91.83 57
2024-06-29-15:50:01 272.9 128.8 237.6 72.75 68 92.44 57
2024-06-29-16:00:01 273.4 128.2 236.8 72.73 72 92.07 57
2024-06-29-16:10:01 274.3 127.7 236.5 72.73 72 91.67 57
2024-06-29-16:20:01 274.7 127.2 236.4 72.41 69 91.06 56
2024-06-29-16:30:01 276.1 126.2 235.7 71.44 71 90.68 56
2024-06-29-16:40:01 276.2 126.3 235.4 70.79 71 90.14 56
2024-06-29-15:30:01 276.6 126.6 235.5 71.47 71 90.05 56
2024-06-29-17:00:01 277.4 127.1 235.2 71.73 69 89.60 56
2024-06-29-17:10:01 277.6 128.6 235.3 71.22 72 89.28 55
2024-06-29-17:20:01 278.1 129.8 235.5 71.17 71 89.37 55
Occasionally the date will be off by one day. So not it's just one character (12:50:01), and it's not off by a consistent amount, but the incorrect times are always in the past (e.g. too early); they are never late.

Is there any known condition that can cause an RPi to report the wrong date/time?

Statistics: Posted by TheWaterbug — Sun Jun 30, 2024 4:18 am



Viewing all articles
Browse latest Browse all 4878

Trending Articles