Bebopgeo Posted December 24, 2009 Share Posted December 24, 2009 I have a field in my mysql database name DatePosted and the Field type I'm using is "TIMESTAMP" and the DEFAULT field is "CURRENT_TIMESTAMP" and the ATTRIBUTES field is "onupdate CURRENT-TIMESTAMP and when I add a new ROW it adds the date and time automatically but the date and time looks like this 2009-12-24 06:34:58 but I want it to be entered as 2009/12/24 06:34:58 can the TIMESTAMP format be change so that this format be entered 2009/12/24 06:34:58 ? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 28, 2009 Share Posted December 28, 2009 You can change the format however you want when you select the value.http://dev.mysql.com/doc/refman/5.1/en/dat...ion_date-format Link to comment Share on other sites More sharing options...
Bebopgeo Posted December 31, 2009 Author Share Posted December 31, 2009 Will I went to that website and look at that date/time stuff and I don't under stand none of it. My mysql data base has some fields to fill in when you create a row and the fields that I have are "Field"= DatePosted and "Type"= TIMESTAMP and "Length/Values1"= is blank and "Default2"= CURRENT_TIMESTAMP I have tryed putting stuff in the "Length/Values1"= and nothing works so where do I put in the right stuff and how do I wright it so the date will look like this 2009/12/23 11:45:38 Link to comment Share on other sites More sharing options...
justsomeguy Posted December 31, 2009 Share Posted December 31, 2009 You use the date_format function I linked to to tell it how to format the date when you select it. You can't change how it's stored, only how it's retrieved. They have several examples on that page, you're going to need to understand how it works in order to use it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.