Convert datetime to specific formats in PHP
There are many way to use date time with specific combination with format in PHP..
dd/mm/yyyy | 18/04/2016 | $userdefine = date("d/m/Y", $datetime); |
mm/dd/yyyy | 04/18/2016 | $userdefine= date("m/d/Y", $datetime); |
Without mins/seconds | 18 April 2016 | $userdefine= date("d F Y", $datetime); |
With mins/seconds | 18 April 2016 10:12:59 | $userdefine= date("d F Y H:i:s", $datetime); |
There are same other formats like $userdefine= date(“m-d-Y”, $datetime);
echo $userdefine; —output like this 04-18-2016
$userdefine = date(“d-m-Y”, $datetime);
echo $userdefine; ——out put like this 18-04-2016