K
K
kolya_krut2018-12-21 18:30:49
JavaScript
kolya_krut, 2018-12-21 18:30:49

How to change PostgreSQL date format on save?

There is a date widget in which the date format is dmY H:i. No special format conversions are performed when the model is saved.
Locally, dates are saved correctly, i.e. in the date table in Ymd H:i:s format. But on the remote server an error occurs:

SQLSTATE[22008]: Datetime field overflow: 7 ERROR: date/time field value out of range: "10/21/2018 5:30 PM"

The Yii2 code and settings are the same everywhere. Both servers have PostgreSQL version 10.6.
How to teach Postgres on a remote server to convert dates in the same way as the local one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2016-02-24
@SPAHI4

https://habrahabr.ru/post/140235/

K
kolya_krut, 2018-12-21
@kolya_krut

In general, it was necessary to change the datestyle in the Postgres config and the rules flew

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question