cleary1981 Posted July 23, 2008 Share Posted July 23, 2008 Hi, I know how to format a date that I have read out of my db using date('d-m-Y',strtotime($row['deadline'])) but when im adding a date value what do I need to do? Quote Link to comment Share on other sites More sharing options...
paul2463 Posted July 23, 2008 Share Posted July 23, 2008 what is the datatype for the column you are adding the date too???? Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 23, 2008 Share Posted July 23, 2008 if the column for the date in the database is simply varchar then you can format the date with PHP first, and insert it into the database that way. Quote Link to comment Share on other sites More sharing options...
cleary1981 Posted July 23, 2008 Author Share Posted July 23, 2008 it is in date format. Is it easier to store as varchar? Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted July 23, 2008 Share Posted July 23, 2008 doesn't really matter, with varchar, you have the flexibility of inserting the date as a string. With a timestamp, it must be of the correct timestamp format. It would probably be easier to use Timestamp. But in saying that. It isn't too hard to create your own custom function to grab your date if it was put into a string column(varchar). Quote Link to comment Share on other sites More sharing options...
TempleDMDKrazd Posted July 23, 2008 Share Posted July 23, 2008 it is in date format. Is it easier to store as varchar? i think timestamp is easier..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.