Please note that I do N_O_T write in the DB. I R_E_A_D it : "asterisk" (software for PABX, see WK) writes for me. My DB is soon written.
About ->parse_timestamp_with_time_zone(), pease see above to see my code. In fact, I have tried all...
Please note that I do N_O_T write in the DB. I R_E_A_D it : "asterisk" (software for PABX, see WK) writes for me.
That does not imply that asterisk is properly set up. at https://wiki.asterisk.org/wiki/display/AST/PostgreSQL+CDR+Backend it implies that the column should be "calldate timestamp NOT NULL" but it seems yours might be "calldate timestamp with timezone NOT NULL". If "asterisk" does not supply time zone information when inserting the data it is quite possible that 23:55 is being converted to GMT prior to insertion but postgres is thinking it is in paris time and converts it to GMT AGAIN to store in its database, which is then converted to 21:55+02 on output to you.
I agree that the real solution is to fix whatever is writing into the database
#!/usr/bin/perl
use strict;
use DBD::Pg;
my $dsn = "dbi:Pg:dbname=asterisk;host=www.ibm.fr";
my $dbh = DBI->connect($dsn,'asterisk','secret') or die $DBI::errstr;;
my $sql = 'SELECT CURRENT_TIMESTAMP, LOCALTIMESTAMP';
print join "\n",$dbh->selectrow_array($sql);
$dbh->disconnect;