I know there is a MySQL function that converts string to date, but it requires the string format.
Is there a way to do it without knowing the format?
Or is there a way to get the format using PHP so that I can use it in MySQL?
I know there is a MySQL function that converts string to date, but it requires the string format.
Is there a way to do it without knowing the format?
Or is there a way to get the format using PHP so that I can use it in MySQL?
Do you mean this ?
SELECT unix_timestamp('2013-11-14'),
unix_timestamp('2013/11/14'),
unix_timestamp('13/11/14'),
unix_timestamp('13-11-14'),
from_unixtime(unix_timestamp('13-11-14'))
This will output
1384358400 1384358400 1384358400 1384358400 "2013-11-14 00:00:00".
use strtotime() function of php, hope it may help go through below link.