Page 1 of 1

date format problem in PHP

Posted: Thu Jun 28, 2007 4:34 am
by jiturc889
Hello ,

I am currently facing problem with date in php , whenever there is empty date field to be put in the mysql database, it automatically captures the timestamp as 943900200 when formatted it becomes '30-11-1999' which is wrong date.
facing this problem everywhere in application.
cant find the solution for this one,
currently handling this error by hard coding the above timestamp...
please suggest a solution for this one...

thank you in advance

Posted: Thu Jun 28, 2007 4:38 am
by volka
jiturc889 wrote:whenever there is empty date field to be put in the mysql database, it automatically captures the timestamp as 943900200 when formatted it becomes '30-11-1999' which is wrong date.
What is the right date in this case?

Posted: Thu Jun 28, 2007 4:50 am
by jiturc889
whatever date i select in my form, is get inserted into data base correctly, but when i dont select any date, that means it should be a blank field in data base, but insted it gets above timestamp automatically

Posted: Thu Jun 28, 2007 7:40 am
by idevlin
jiturc889 wrote:whatever date i select in my form, is get inserted into data base correctly, but when i dont select any date, that means it should be a blank field in data base, but insted it gets above timestamp automatically
Unless the field in your database is set to "NOT NULL" meaning that it cannot be blank? It might then be inserting a default value which is the value you mentioned above.