6

Hi i am trying to insert a date in my table. But i am getting the error. I also tried two solutions which i found:

set datestyle to SQL,DMY;

set datestyle = dmy;

But the problem still exists. Please help where i am doing mistake. This is the error:

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'[email protected]', 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
2
  • try using "show datestyle;" to see if your configuration ever made a difference. In any case note that you have one date in the yyyy/mm/dd format so even if you succeed, it will fail on the other one. Commented Jul 24, 2016 at 8:35
  • It is showing "ISO, MDY" Commented Jul 24, 2016 at 8:40

1 Answer 1

2

I have to change the date format in html input tag to the Postgres date format. Thanks to @Avision for telling me how can i see the current date format used by the Postgres.

I changed it and now it is working fine :)

  <input type="text" data-date-format="mm-dd-yyyy" >
Sign up to request clarification or add additional context in comments.

1 Comment

I don't really understand this answer. Care to elaborate about what to change where. Where does this line of HTML go and how does it relate to postgres?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.