From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH v2 pmg-api] MailTracker: remove timezone offset
Date: Mon, 19 Feb 2024 18:55:48 +0100 [thread overview]
Message-ID: <20240219175548.311288-6-m.limbeck@proxmox.com> (raw)
In-Reply-To: <20240219175548.311288-1-m.limbeck@proxmox.com>
The timezone offset is moved to `pmg-log-tracker` in the
compatibility code path. This way the new rfc3339 timestamp, which is
already in UTC, can be used as is.
Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
v2:
- no changes
src/PMG/API2/MailTracker.pm | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/PMG/API2/MailTracker.pm b/src/PMG/API2/MailTracker.pm
index b8b25ad..ffda4b5 100644
--- a/src/PMG/API2/MailTracker.pm
+++ b/src/PMG/API2/MailTracker.pm
@@ -43,8 +43,6 @@ my $run_pmg_log_tracker = sub {
my $logids = {};
- my $timezone = tz_local_offset();;
-
if (defined(my $id = $includelog)) {
if ($id =~ m/^Q([a-f0-9]+)R([a-f0-9]+)$/i) {
$logids->{$1} = 1;
@@ -128,7 +126,7 @@ my $run_pmg_log_tracker = sub {
} elsif ($line =~ m/^TO:([0-9A-F]+):([0-9A-F]+):([0-9A-Z]):\s+from <([^>]*)>\s+to\s+<([^>]+)>\s+\((\S+)\)$/) {
my $new = {
size => $entry->{size} // 0,
- time => hex($1) - $timezone,
+ time => hex($1),
qid => $2,
dstatus => $3,
from => $4,
@@ -174,7 +172,7 @@ my $run_pmg_log_tracker = sub {
} elsif ($line =~ m/^TO:([0-9A-F]+):(T[0-9A-F]+L[0-9A-F]+):([0-9A-Z]):\s+from <([^>]*)>\s+to\s+<([^>]*)>$/) {
my $e = {};
$e->{client} = $entry->{client} if defined($entry->{client});
- $e->{time} = hex($1) - $timezone;
+ $e->{time} = hex($1);
$e->{id} = $2;
$e->{dstatus} = $3;
$e->{from} = $4;
--
2.39.2
next prev parent reply other threads:[~2024-02-19 17:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-19 17:55 [pmg-devel] [PATCH v2 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 pmg-log-tracker 2/5] tests: improve test output consistency Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 pmg-log-tracker 3/5] tests: update for log tracker time handling changes Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 pmg-log-tracker 4/5] cleanup: remove unused strftime function Mira Limbeck
2024-02-19 17:55 ` [pmg-devel] [PATCH v2 5/5] cleanup: fix clippy warnings Mira Limbeck
2024-02-19 17:55 ` Mira Limbeck [this message]
2024-02-20 9:37 ` [pmg-devel] [PATCH v2 pmg-log-tracker 1/5] rfc3339: move timezone offset compatibility code to old time parser Mira Limbeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240219175548.311288-6-m.limbeck@proxmox.com \
--to=m.limbeck@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox