0

I have django project and one separate service.

In django timezone is UTC+3 and in separate service I have written pure sql codes

like below

INSERT INTO  Table(something,something,datetime) VALUES(%s,%s,%s)

as a datetime field if I send 2021-04-28 01:00:00, django will save it 2021-04-28 04:00:00,

3 hours more. How can I implement db to store exactly what I send there.

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
Elvin Jafarov
  • 1,341
  • 11
  • 25
  • If you are executing raw SQL then Django has nothing to do with this behaviour. Instead, review the Postgresql docs for datetime/timestamp fields. – snakecharmerb Apr 29 '21 at 06:50
  • Have you tried to insert a timestamp with timezone information? – hendrikschneider Apr 29 '21 at 06:52
  • 1
    Does this answer your question? [Date and time in UTC - how to store them in postgres?](https://stackoverflow.com/questions/44432682/date-and-time-in-utc-how-to-store-them-in-postgres) – snakecharmerb Apr 29 '21 at 06:52

0 Answers0