jiturc889 Posted June 28, 2007 Share Posted June 28, 2007 hello, I am facing one problem in php, mysql whenever i submit empty date to db, it automatically takes timestamp as 943900200 ('30-11-1999') which is creating problems in my application..... currently handling this problem by hard coding timestamp validation..... If anyone knows anything , please suggest a solution... thanking in advance Link to comment https://forums.phpfreaks.com/topic/57536-date-format-timestamp-problem/ Share on other sites More sharing options...
phpknight Posted June 28, 2007 Share Posted June 28, 2007 I am not sure why you would want to send an empty date. You can use NOW(), and that will give you the current date. Will that work for you? Link to comment https://forums.phpfreaks.com/topic/57536-date-format-timestamp-problem/#findComment-284734 Share on other sites More sharing options...
jiturc889 Posted June 28, 2007 Author Share Posted June 28, 2007 actually in my form , there r 5 dates to be selected by user, but whenever he dont have anyone date, he just leaves tht, yes, n he can update it later.. but in the case i cant make them compulsary fields, user can/can not have all the dates at the time.... Link to comment https://forums.phpfreaks.com/topic/57536-date-format-timestamp-problem/#findComment-284736 Share on other sites More sharing options...
phpknight Posted June 28, 2007 Share Posted June 28, 2007 What about if you tested for an empty date and then just left the database with the default? So, if they pick one, you insert it. If they don't, you do a different query. Link to comment https://forums.phpfreaks.com/topic/57536-date-format-timestamp-problem/#findComment-284738 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.