title: Is there a way to change Rails default timestamps to Y-m-d H:i:s (instead of Y-m-d H:i:s.u) or have laravel ignore decimal portion of Y-m-d H:i:s.u?
body: <p>I have two applications using the same postgres DB. A laravel application and a rails application. The current data in the DB is in <code>Y-m-d H:i:s</code> format but whenever rails adds a records, the format is <code>Y-m-d H:i:s.u</code> which includes milliseconds. </p>
  
  <p>This causes the following error on the laravel side if the created_at date is ever references in laravel <code>InvalidArgumentException Trailing data</code>...</p>
  
  <p>Laravel models can mutate their date format, so I can include make it conform to <code>Y-m-d H:i:s.u</code> then I would need to update all the records to have the miliseconds in the created_at date ( and any other timestamps). Unfortunatly when I specify the format to be <code>Y-m-d H:i:s</code> for the laravel model, it will not ignore the decimals. This is why I'm now looking for ways to default rails to save in the <code>Y-m-d H:i:s</code> format, instead of including the miliseconds. Then both the Rails and Laravel applications would be using the same format and there wouldn't be any conflict.</p>
  
  <p>I know I can go into the DB and change the column type to timestamp(0) which truncates the decimals, but I would perfer to change the format that the frameworks are saving, rather then change what the DB will accept. </p>
  
  <p>Both <code>Y-m-d H:i:s</code> and <code>Y-m-d H:i:s.u</code> are valid timestamps... If I could get Rails to use the <code>Y-m-d H:i:s</code> format or have Laravel ignore the .u when looking at timestamps to prevent the trailing data error, I would be in the clear.</p>
  
  <p>Is there a way to change the default format that rails saves timestamps to the DB?</p>
  
  <p>Is a way to have Larave Carbon ignore the decimal portion of a timestamp in the <code>Y-m-d H:i:s.u</code> format?</p>
  
  <p>Thanks</p>