This is my code below :
$startDate= str_replace('/', '-', $bhishi_date);
$startDate=strtotime($startDate);
$startDate= date('Y-m-d', strtotime($startDate))
This is my code below :
$startDate= str_replace('/', '-', $bhishi_date);
$startDate=strtotime($startDate);
$startDate= date('Y-m-d', strtotime($startDate))
Try Below Code its help for you.
$startDate= date('Y-m-d', strtotime($bhishi_date))
You can use Carbon
too:
$startDate = \Carbon\Carbon::parse('10/05/2025');
To deal with dates and times, I prefer to use the build-in DateTime class with which you can do everything in a consistent syntax.
$startDate = \DateTime::createFromFormat('d/m/Y', '10/05/2025')->format('Y-m-d');
// input format ---------^^^^^ output format ---------^^^^^