From 5082d5e74f6a92928c097f1afcf3dfa1df2e479c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 11 Oct 2012 12:42:35 +0200 Subject: [PATCH] =?UTF-8?q?Utilisation=20de=20localtime=20=C3=A0=20la=20pl?= =?UTF-8?q?ace=20de=20DateTime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- root/usr/share/qpsmtpd/plugins/logging/log2sql | 8 ++++---- smeserver-qpsmtpd-log2sql.spec | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/root/usr/share/qpsmtpd/plugins/logging/log2sql b/root/usr/share/qpsmtpd/plugins/logging/log2sql index 3a795fe..124616e 100644 --- a/root/usr/share/qpsmtpd/plugins/logging/log2sql +++ b/root/usr/share/qpsmtpd/plugins/logging/log2sql @@ -10,7 +10,6 @@ ##################################################### use DBI; -use DateTime; use strict; #plugin level variables are here since version 0.02 @@ -68,7 +67,8 @@ $transaction->notes('log2sql_mail_id', $mail_id); # quote the mail_id for later use: $mail_id = $dbh->quote($mail_id); -my $dt = DateTime->now; +my ($sec,$min,$hour,$day,$mon,$year) = localtime; +$year += 1900; my($statement) = "INSERT INTO ".$mail_table." (mail_id,". $mail_table.".date_day,". @@ -76,8 +76,8 @@ my($statement) = "INSERT INTO ".$mail_table." (mail_id,". "remote_ip,remote_host,remote_info) ". "VALUES(". $mail_id.",". - $dbh->quote($dt->ymd).",". - $dbh->quote($dt->hms).",". + $dbh->quote($year.'-'.$mon.'-'.$day).",". + $dbh->quote($hour.':'.$min.':'.$sec).",". $dbh->quote($self->qp->connection->remote_ip).",". $dbh->quote($self->qp->connection->remote_host).",". $dbh->quote($self->qp->connection->remote_info).")"; diff --git a/smeserver-qpsmtpd-log2sql.spec b/smeserver-qpsmtpd-log2sql.spec index cc3e497..78d57ed 100644 --- a/smeserver-qpsmtpd-log2sql.spec +++ b/smeserver-qpsmtpd-log2sql.spec @@ -17,7 +17,6 @@ BuildRequires: e-smith-devtools Requires: smeserver-qpsmtpd Requires: e-smith-mysql -Requires: perl(Date::Time) Requires: perl(DBI) %description