With unix epoch time, you don't have to worry about leap seconds. A day is
always guaranteed to be exactly 86,400 seconds long. If a leap second
occurred during the day, the final epoch time of the day is repeated twice.
This makes the math of converting to and from wall clock time super easy.
For
John, Greg,
This is very helpful! I assumed it was adding a second to the timestamp,
but I see now, through the explanations, that it's incrementing the five
minute periods since the epoch. A very cool piece of timestamp math.
Thanks!
--
You received this message because you are subscribed
Pat writes:
> I don't know why, but I'm fascinated with this small bit of code. I always
> wondered how the archive interval runs on the 5th minute reliably (on a
> vanilla install). It doesn't matter when you start weewx, it'll run on that
> 5th minute interval. If I start weewx at 8:31, I'll
Standard "fence post" math. :-)
On Mon, Sep 2, 2019 at 5:42 PM Pat wrote:
> I don't know why, but I'm fascinated with this small bit of code. I always
> wondered how the archive interval runs on the 5th minute reliably (on a
> vanilla install). It doesn't matter when you start weewx, it'll run o
No magic here.
The division doesn’t give you 5224903, it gives you 5224903.21667 or so. The
“int()” knocks off the decimals. It does NOT round up. As such, you are
getting the LAST 5 minute period, that is the number of 5 minute periods that
have already passed since the epoch.
If you had n
I don't know why, but I'm fascinated with this small bit of code. I always
wondered how the archive interval runs on the 5th minute reliably (on a
vanilla install). It doesn't matter when you start weewx, it'll run on that
5th minute interval. If I start weewx at 8:31, I'll get an archive (most