prashanth ag
asked on
convert yyyy-mm-dd to mm/dd/yyyy in php
Before it was working fine this format getbusinessDays("2015-01-0 1","2015-1 2-31",$hol idays)
function getbusinessDays($startDate ,$endDate, $holidays)
{
$endDate = strtotime($endDate);
$startDate = strtotime($startDate); before
}
i want convert yyyy-mm-dd to mm/dd/yyyy
function getbusinessDays($startDate ,$endDate, $holidays)
{
$endDate = date('mm/dd/yyyy', strtotime($endDate));
$startDate = date('mm/dd/yyyy', strtotime($startDate));
}
but it shows error
Notice: A non well formed numeric value encountered (i.,e both lines @$endDate & $startDate)
function getbusinessDays($startDate
{
$endDate = strtotime($endDate);
$startDate = strtotime($startDate); before
}
i want convert yyyy-mm-dd to mm/dd/yyyy
function getbusinessDays($startDate
{
$endDate = date('mm/dd/yyyy', strtotime($endDate));
$startDate = date('mm/dd/yyyy', strtotime($startDate));
}
but it shows error
Notice: A non well formed numeric value encountered (i.,e both lines @$endDate & $startDate)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
Going forward, you might want to check the E-E articles, since many of the most common PHP questions are answered there with examples!