Playing a little around, this is confusing me:
$span(hour_delta=720).length.day.format("%d")
=> 29 days. Okay...

$span(hour_delta=720).length.long_form
=> 719 hours, 0 minutes, 0 seconds. ???
So, for the hours, I can't think of a scenario, where I consider this as a 
correct result, and there isn't room for a rounding issue.

Nailing it down to the DST change, with the following lines
$span(hour_delta=632).length.long_form
$span(hour_delta=631).length.long_form
$span(hour_delta=630).length.long_form
$span(hour_delta=629).length.long_form
I get these results:
631 hours, 0 minutes, 0 seconds
630 hours, 0 minutes, 0 seconds
630 hours, 0 minutes, 0 seconds
629 hours, 0 minutes, 0 seconds


Karen K schrieb am Donnerstag, 24. April 2025 um 21:07:02 UTC+2:

> [email protected] schrieb am Donnerstag, 24. April 2025 um 11:41:39 
> UTC+2:
>
> But anyway, I also wonder what is really the issue. It may or may not be 
> just the label. depending on how the day_delta sum is calculated. Is it the 
> sum of the archive_day sums? Is it the sum of archive's rain column, over 
> 30 x 24h? 
>
>
>
> May be, it is a matter of rounding. If the time period is 29 days and 23 
> hours, it is almost 30 days, but if you omit rounding it is 29 days.
>
> Internally all timestamps are seconds since 1970-01-01 00:00:00 UTC. To 
> get a timespan of days WeeWX uses the functions 
> weeutil.archive{Day,Week,Month,Year}Span(),  which convert the value into 
> a tuple of year, month, day, hour, minute, second local time, sets hour, 
> minute, second to 0, applies the appropriate amount of days, and finally 
> converts both ends back to seconds since 1970-01-01 00:00:00 UTC. If the 
> timespan includes a daylight saving time switch, it is - in seconds - not 
> whole days but an hour more or less.
>
>

-- 
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 visit 
https://groups.google.com/d/msgid/weewx-user/faee8c21-e968-4bcb-8aca-15ab5a1cc8ban%40googlegroups.com.

Reply via email to