src/Lib/Time.php
public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
    {
        $datetime = new \DateTime($datetime);

        if($timezone) {

            $datetime->setTimezone(new \DateTimeZone($timezone));
        }

        return $datetime->format($format); 
    }
public function datetime($datetime, $timezone = null, $format = 'M/d/Y - h:i:s A')
    {
        $datetime = new \DateTime($datetime);

        if($timezone) {

            $datetime->setTimezone(new \DateTimeZone($timezone));
        }

        return $datetime->format($format); 
    }
public function datetime ( $ datetime , $ timezone = null , $ format = 'M/d/Y - h:i:s A' ) { $ datetime = new \ DateTime ( $ datetime ) ; if ( $ timezone ) { $ datetime -> setTimezone ( new \ DateTimeZone ( $ timezone ) ) ; } return $ datetime -> format ( $ format ) ; }
Set Date and Time
Set Date and Time