Postgresql错误:日期/时间字段值超出范围

时间:2016-07-24 08:13:18

标签: php mysql sql postgresql

您好我想在我的桌子上插入一个日期。但我得到了错误。我也 我找到了两个解决方案:

set datestyle to SQL,DMY;

set datestyle = dmy;

但问题仍然存在。请帮助我在哪里做错了。这是错误:

Error Number:

ERROR: date/time field value out of range: "24-07-2016" LINE 1: ...isalabad', E'Chief Executive ', E'1994-10-13', E'24-07-20... ^ HINT: Perhaps you need a different "datestyle" setting.

INSERT INTO "employee" ("fullname", "loginname", "email", "password", "phone", "cnic", "address", "jobdescription", "birthdate", "registered", "qualification", "lastcompany", "lastsalary", "status", "location", "department", "designation", "path") VALUES ( E'Shahzeb Akram', E'shaizi96', E'shaizi@test.com', E'1234', E'3137688894', E'33100-8398084-5', E'Faisalabad, Faisalabad', E'Chief Executive ', E'1994-10-13', E'24-07-2016', E'BSCS', E'BOLT', E'121212', E'1', '', E'39', E'43', E'http://localhost/department/uploads/Shahzeb Akram/Screenshot_(1).png')

Filename: C:/wamp/www/department/system/database/DB_driver.php

Line Number: 691

1 个答案:

答案 0 :(得分:1)

我必须将html输入标记中的日期格式更改为Postgres日期格式。感谢@Avision告诉我如何才能看到Postgres使用的当前日期格式。

我改变了它,现在工作正常:)

  <input type="text" data-date-format="mm-dd-yyyy" >