Zeradin Posted September 17, 2008 Share Posted September 17, 2008 I can't find it. I have a current timestamp and the stamp is coming out like: 20DD.MM.YY a little off... i didnt' set anything so wtf Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted September 17, 2008 Share Posted September 17, 2008 A mysql TIMESTAMP/DATETIME/DATE format is YYYY-MM-DD. If you have values 20DD.MM.YY, that would mean that you put a DD-MM-YY into a TIMESTAMP/DATETIME/DATE field that happened to have a DD that was a valid YY and a YY that was a valid DD so that they were accepted as being valid values. You need to start by putting in YYYY-MM-DD values. You can use the mysql STR_TO_DATE() function to take any format of date/time and given a YYYY-MM-DD value. To SELECT a TIMESTAMP/DATETIME/DATE value and format it any way you want on output, use the mysql DATE_FORMAT() function. Quote Link to comment Share on other sites More sharing options...
Zeradin Posted September 17, 2008 Author Share Posted September 17, 2008 whoa whoa whoa sorry that was very foreign to me so like 'SELECT DATE_FORMAT(timestamp, (theformat)) FROM news WHERE id=1' ? or something? is there an easy way to do this in phpmyadmin? Quote Link to comment Share on other sites More sharing options...
Zeradin Posted September 17, 2008 Author Share Posted September 17, 2008 problem was i was writing into the table funny instead of letting it do the job itself... I guess i'll just accept the standard sql format. Thanks! 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.