Jump to content

Change a datetime data content in a string into a datetime mysql format in php


danielchen

Recommended Posts

Being from the UK I assume your current dates are dd/mm/yyyy (impossible to tell from your date samples) so adjust as necessary.

UPDATE tablename 
SET fecha = STR_TO_DATE(`Date/Time`, '%d/%m/%Y %H:%i:%s')

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.