php - mysql adjusting datetime values in the dbase, not in search returns -


This should be a ridiculously stupid question, because I did not know after many searches on Stack Overflow question archives (and elsewhere) an answer.

I recently dated & amp; After the advice of Mike B. I added two zeros at the end of my YMDDHHMM string and made them DATETIME format as YYMMDDHHMMSS and then copied them to a new column. DATETIME formatting to my surprise (though probably guessed), when the script was over, I now had a DATETIME column, where there was a 20XX variety instead of 1978 every year!

Oh

Since then, I am trying to figure out that instead of trashing the new column and reusing the original integers, I am trying to change it by working directly on the DATETIME column (I I want to do this in the "right way") and I'm guessing use DATE_SUB and INTERVAL 100 YEAR, but as a real creation of the code, either stumped directly through MySQL or PHP.

Again, I want to apologize, it should be really obvious.

Thank you

  • A

< Pre> set my_table my_date_column = date_sub (my_date_column, interval year 100);

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -