Not to be too terribly pedantic, but unix time does deal with leap seconds. It's just that it deals with them using a discontinuity at midnight. The result is that if you calculate the difference in unix epoch time between, say, 23:55 and 00:10, it will *always* be 900 seconds, even if a leap second was inserted in there. However, if you were to calculate the difference in UTC, it would be 901 seconds if a leap second occurred.
99.9% of the time, this is what you want. It's a brilliant solution to a difficult problem. The only problem is that every couple of years or so, there will be a unit timestamp that is ambiguous. There will be two times with the same timestamp. On Fri, Nov 4, 2022 at 3:35 AM Greg Troxel <[email protected]> wrote: > > Phillip Fischer <[email protected]> writes: > > > Thank You! I am fairly new to the world of linux and learning new things > > each day! I appreciate your time to answer my question. > > This is likely beyond what you care about, but note that the time values > are the number of seconds since January 1, 1970 UTC **as if there were > no leap seconds**. > > But with weather data every 15 minuts, that just means that occasionally > those timestamps that differ from 900 will be 901 (or maybe in the > future 899 seconds apart). And, surely your weather station doesn't > have leap second support, and your computer doesn't have a network > connection. > > > But seriously, I don't know how you are dealing with time, and probably > you want to have a GPS receiver and run ntpd to sync the RPI's clock, > and understand how that relates to the weather station's clock. > > You probably also want to run the RPI in UTC, and also the weather > stations, so that there is no daylight savings time confusion. weewx > does not as far as I know support "operate in UTC but produce > graphs/summaries in local time (meaning "today" as a 24h period, > min/max, etc.)". But you are just going to process the weewx.sdb > elsewhere. > > I would also put a USB SSD or stick in the Pi and back up the weewx.sdb > to that daily, in a way that doesn't overwrite the previous backups. > And a UPS (even a Pi UPS with a battery, but beware of lithium batteries > below freezing). > > -- > You received this message because you are subscribed to the Google Groups > "weewx-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/rmimt9757os.fsf%40s1.lexort.com > . > -- You received this message because you are subscribed to the Google Groups "weewx-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEAJxSXy1dOwePPPWDVXuSoPGdfYVUx9R4kvk%2Bpm%3DDsSsg%40mail.gmail.com.
