I gone through convert php date to mysql format but still i have few issues and questions,
In general, my application can input dates in Y-m-d, d-m-y, m-d-Y, jS, F Y format, or even with '/' separator.
I want this dates to be converted to in mysql Y-m-d format, I tried as below, but it shows different output then expected,
Non working
date_format(date_create_from_format('d-m-Y', '02-25-2016'), 'Y-m-d');
Working
date_format(date_create_from_format('d-m-Y', '25-02-2016'), 'Y-m-d');
So it seems format and string to be match in same way, otherwise its not interpreting correctly,
What is best way to convert above 4 format inputs to mysql(Y-m-d) format?
Thanks advanced,
