title: How to update timestamp column moving date forward
body: <p>what I am looking for is some help with a query.</p>
  
  <p>I have a MySql field with unixtime in it representing a date in each of the next few dozen months.  I have to move the dates forward to the first day of the next month for each entry in the table.</p>
  
  <p>The dates are all the 20th of each month, and so I want to move June 20 to July 1, July 20 to August 1, and so on.  I can't just add 11 days, because that wouldn't be the first day of the next month when considering months with 31 days and February.</p>
  
  <p>I have been playing with ideas like this:</p>
  
  <pre><code>update table set column = UNIX_TIMESTAMP(column + MONTH(column)+1,DAY(1)) where index_column = '1234'
  </code></pre>
  
  <p>but I am pretty sure that won't work.  I could use something like this to convert it, then try to convert it back:</p>
  
  <pre><code>update table set column = DATEFORMAT(column,'%Y-$c-%d %H:%i:%s') where index_column == '1234'
  </code></pre>
  
  <p>I still think there has to be a better way.  Frankly, I would update the few dozen manually, but I know this will come up frequently, and don't want to have to do it manually every time.  </p>
  
  <p>I prefer not to use code, but would instead like to just do it directly into MySql.  I hope there is someone out there that can help me figure this out.</p>
  
  <p>Thank you in advance.</p>