Currently, I have date from my database every time I start the session the date format looks like this: 2022-09-26 05:19:34
In order for the date format to become friendly on the front end or client side, I use this function:
date("F j, Y", strtotime( $fetchDate ));
The generate output look like this: September 26, 2022
Then, however, I need to filter the session in admin by "Date" the format from the client side is not the same as the date format in my database, right? enter image description here
To makes long story short how can I convert my string Date format into the default database format that I can use when I filter by "Date" in my database
// Here is the example of a filter I need to do
SELECT * FROM `start_session` WHERE `Date_created` = '2022-09-26 05:19:34'
// However as you can see I have this kind of wrong
SELECT * FROM `start_session` WHERE `Date_created` = 'September 26, 2022'
If I can convert this date 2022-09-26 05:19:34
into this format September 26, 2022
using this function date("F j, Y", strtotime( $fetchDate ))
How can I convert this date format September 26, 2022
to become like this format 2022-09-26 05:19:34
Thank you in advance!