[pmg-devel] applied-series: [PATCH v3 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Feb 27 15:07:38 CET 2024
Am 20/02/2024 um 11:06 schrieb Mira Limbeck:
> The compatibility code was added to the new rfc3339 code path temporarily so
> that the old code path would not be changed before the PMG 8 release.
>
> Now move it to the old time format code to make sure the rfc3339 code path
> works as expected. Since we have all the information we need (year, month,
> day, hours, minutes, seconds, timezone), there's no need for a workaround in
> this code path.
>
> As a side effect of parsing the time format `YYYY-MM-DD HH:MM:SS` in
> localtime, it's now possible to parse an rfc3339 compliant format
> (except for fractional seconds).
>
> The change needs to be accompanied by one in pmg-api MailTracker.pmg to
> keep the time displayed in the GUI the same for the old time format, and
> correct for the new rfc3339 format.
>
> Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
> ---
> I've tested it locally with both old timestamp format and new one, but
> running it on more logs would not hurt
>
> Since we use only the start time to calculate the timezone offset, it
> will not be reliable in all cases, especially when the end time offset
> differs from the start time.
>
> v3:
> - changed file in range of start/end time check to use the start time
> timezone offset, which allowed us to remove the timezone_offset
> member of the parser struct
>
> v2:
> - removed TODO line
> - fixed start-/endtime offset mentioned by @stoiko on the rfc
> - added rfc3339 start-/endtime handling as suggested by @dominik since
> it eases parsing the YYYY-MM-DD HH:MM:SS format as localtime rather
> than UTC
> - added tests in another patch
>
> src/main.rs | 65 ++++++++++++++++++++++++++++++-----------------------
> src/time.rs | 23 ++++++++++++++++++-
> 2 files changed, 59 insertions(+), 29 deletions(-)
>
>
For the record, this series has been applied yesterday by Stoiko, thanks!
More information about the pmg-devel
mailing list