Trying to save a date in PostgreSQL using Python, it gives me an UTC+2 for my timezone while it is UTC+1 (dont mind the difference, I just used a Python test to get how the timezone is)
In [8]: datetime.datetime.now(pytz.timezone("Africa/Algiers"))
Out[8]: datetime.datetime(2018, 7, 7, 15, 27, 43, 756977, tzinfo=<DstTzInfo 'Africa/Algiers' CET+1:00:00 STD>)
On PostgreSQL, I get
2018-07-07 14:28:04.144505+02

This is like postgresql adds a daylight saving while we dont have it in Algeria ?
NB: I use asyncpg
Based on Raymond Nijland's answer, that worked, here is how (from PGAdmin 4) The reason is that the OS forces its own timezone and dont save the one that Python gave him.
Just run those three commands from SQL prompt :
To get which timezone PG uses,
SHOW timezone ;
To get all the timezones available and how PG names them
SELECT * FROM pg_timezone_names ;
Put the right timezone
ALTER DATABASE yourDataBase SET timezone TO 'Africa/Algiers';
Restart the service
sudo systemctl restart postgresql-10.service
NB: Even if you use moment.js you need to add .zone(+0100) as mentionned here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With